Class: Ogem::Player

Inherits:
Object
  • Object
show all
Defined in:
lib/ogem/player.class.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name = "Player", m = 1000, c = 1000, d = 0) ⇒ Player

Returns a new instance of Player.



9
10
11
12
13
14
15
16
17
# File 'lib/ogem/player.class.rb', line 9

def initialize name="Player", m=1000, c=1000, d=0
  if !name.is_a?String
    Error.call "Ogem::Player::new : invalid name", Error::ERR_MEDIUM
    name = "Player"
  end

  @name = name
  @r = {m: m.to_i, c: c.to_i, d: d.to_i}
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



7
8
9
# File 'lib/ogem/player.class.rb', line 7

def name
  @name
end

#rObject

Returns the value of attribute r.



7
8
9
# File 'lib/ogem/player.class.rb', line 7

def r
  @r
end