Class: CodenjoyConnection::Player
- Inherits:
-
Object
- Object
- CodenjoyConnection::Player
- Defined in:
- lib/codenjoy_connection/player.rb
Instance Method Summary collapse
-
#initialize(player) ⇒ Player
constructor
A new instance of Player.
- #make_step ⇒ Object
- #process_data(data) ⇒ Object
Constructor Details
#initialize(player) ⇒ Player
Returns a new instance of Player.
3 4 5 6 7 8 |
# File 'lib/codenjoy_connection/player.rb', line 3 def initialize(player) raise CodenjoyConnection::GenericError.new('Please, override #process_data in your player class.') unless player.respond_to?(:process_data) raise CodenjoyConnection::GenericError.new('Please, override #make_step in your player class.') unless player.respond_to?(:make_step) @player = player end |
Instance Method Details
#make_step ⇒ Object
14 15 16 |
# File 'lib/codenjoy_connection/player.rb', line 14 def make_step @player.make_step end |
#process_data(data) ⇒ Object
10 11 12 |
# File 'lib/codenjoy_connection/player.rb', line 10 def process_data(data) @player.process_data(data) end |