Class: Atoyrobot::Commands::Place

Inherits:
Base
  • Object
show all
Defined in:
lib/atoyrobot/commands/place.rb

Instance Method Summary collapse

Methods inherited from Base

descendants_names

Constructor Details

#initialize(*args) ⇒ Place

Returns a new instance of Place.



14
15
16
17
# File 'lib/atoyrobot/commands/place.rb', line 14

def initialize(*args)
  super
  @location = Location.new(x, y, facing)
end

Instance Method Details

#execute(robot) ⇒ Object



19
20
21
# File 'lib/atoyrobot/commands/place.rb', line 19

def execute(robot)
  robot.place(@location.x, @location.y, @location.facing)
end