Class: Player
- Inherits:
-
Object
- Object
- Player
- Defined in:
- lib/player.rb
Instance Method Summary collapse
- #go(x, y, z) ⇒ Object
-
#initialize(api) ⇒ Player
constructor
A new instance of Player.
- #location ⇒ Object
Constructor Details
#initialize(api) ⇒ Player
Returns a new instance of Player.
2 3 4 |
# File 'lib/player.rb', line 2 def initialize(api) @api = api end |
Instance Method Details
#go(x, y, z) ⇒ Object
6 7 8 |
# File 'lib/player.rb', line 6 def go(x,y,z) @api.send("player.setTile(#{x},#{y},#{z})") end |
#location ⇒ Object
10 11 12 13 |
# File 'lib/player.rb', line 10 def location response = @api.send_and_receive("player.getTile()") response.split(',').map { |s| s.to_i } end |