Class: Player
Instance Attribute Summary collapse
-
#achievements ⇒ Object
Returns the value of attribute achievements.
-
#agi ⇒ Object
Returns the value of attribute agi.
-
#armour ⇒ Object
Returns the value of attribute armour.
-
#balance ⇒ Object
Returns the value of attribute balance.
-
#def ⇒ Object
Returns the value of attribute def.
-
#dex ⇒ Object
Returns the value of attribute dex.
-
#gold ⇒ Object
Returns the value of attribute gold.
-
#hp ⇒ Object
Returns the value of attribute hp.
-
#int ⇒ Object
Returns the value of attribute int.
-
#lck ⇒ Object
Returns the value of attribute lck.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#res ⇒ Object
Returns the value of attribute res.
-
#str ⇒ Object
Returns the value of attribute str.
-
#weapon ⇒ Object
Returns the value of attribute weapon.
Instance Method Summary collapse
- #beast ⇒ Object
- #dwarf ⇒ Object
- #elf ⇒ Object
- #god ⇒ Object
- #human ⇒ Object
-
#initialize(name) ⇒ Player
constructor
A new instance of Player.
- #knight ⇒ Object
- #mage ⇒ Object
- #ranger ⇒ Object
- #rogue ⇒ Object
Constructor Details
#initialize(name) ⇒ Player
Returns a new instance of Player.
7 8 9 10 11 12 13 14 15 |
# File 'lib/lotrd/model/player.rb', line 7 def initialize(name) @name = name @gold = 0 @balance = 0 @weapon = nil @armour = nil @achievements = [] @status = [] end |
Instance Attribute Details
#achievements ⇒ Object
Returns the value of attribute achievements.
5 6 7 |
# File 'lib/lotrd/model/player.rb', line 5 def achievements @achievements end |
#agi ⇒ Object
Returns the value of attribute agi.
5 6 7 |
# File 'lib/lotrd/model/player.rb', line 5 def agi @agi end |
#armour ⇒ Object
Returns the value of attribute armour.
5 6 7 |
# File 'lib/lotrd/model/player.rb', line 5 def armour @armour end |
#balance ⇒ Object
Returns the value of attribute balance.
5 6 7 |
# File 'lib/lotrd/model/player.rb', line 5 def balance @balance end |
#def ⇒ Object
Returns the value of attribute def.
5 6 7 |
# File 'lib/lotrd/model/player.rb', line 5 def def @def end |
#dex ⇒ Object
Returns the value of attribute dex.
5 6 7 |
# File 'lib/lotrd/model/player.rb', line 5 def dex @dex end |
#gold ⇒ Object
Returns the value of attribute gold.
5 6 7 |
# File 'lib/lotrd/model/player.rb', line 5 def gold @gold end |
#hp ⇒ Object
Returns the value of attribute hp.
5 6 7 |
# File 'lib/lotrd/model/player.rb', line 5 def hp @hp end |
#int ⇒ Object
Returns the value of attribute int.
5 6 7 |
# File 'lib/lotrd/model/player.rb', line 5 def int @int end |
#lck ⇒ Object
Returns the value of attribute lck.
5 6 7 |
# File 'lib/lotrd/model/player.rb', line 5 def lck @lck end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/lotrd/model/player.rb', line 4 def name @name end |
#res ⇒ Object
Returns the value of attribute res.
5 6 7 |
# File 'lib/lotrd/model/player.rb', line 5 def res @res end |
#str ⇒ Object
Returns the value of attribute str.
5 6 7 |
# File 'lib/lotrd/model/player.rb', line 5 def str @str end |
#weapon ⇒ Object
Returns the value of attribute weapon.
5 6 7 |
# File 'lib/lotrd/model/player.rb', line 5 def weapon @weapon end |
Instance Method Details
#beast ⇒ Object
33 34 35 |
# File 'lib/lotrd/model/player.rb', line 33 def beast super end |
#dwarf ⇒ Object
25 26 27 |
# File 'lib/lotrd/model/player.rb', line 25 def dwarf super end |
#elf ⇒ Object
17 18 19 |
# File 'lib/lotrd/model/player.rb', line 17 def elf super end |
#god ⇒ Object
29 30 31 |
# File 'lib/lotrd/model/player.rb', line 29 def god super end |
#human ⇒ Object
21 22 23 |
# File 'lib/lotrd/model/player.rb', line 21 def human super end |
#knight ⇒ Object
41 42 43 |
# File 'lib/lotrd/model/player.rb', line 41 def knight super end |
#mage ⇒ Object
37 38 39 |
# File 'lib/lotrd/model/player.rb', line 37 def mage super end |
#ranger ⇒ Object
49 50 51 |
# File 'lib/lotrd/model/player.rb', line 49 def ranger super end |
#rogue ⇒ Object
45 46 47 |
# File 'lib/lotrd/model/player.rb', line 45 def rogue super end |