Class: Rubots::Command::RotateTo

Inherits:
Base
  • Object
show all
Defined in:
lib/rubots/command/rotate_to.rb

Instance Method Summary collapse

Methods inherited from Base

#cooldown

Constructor Details

#initialize(angle) ⇒ RotateTo

Returns a new instance of RotateTo.



4
5
6
# File 'lib/rubots/command/rotate_to.rb', line 4

def initialize(angle)
  @angle = angle % Robot::MAX_ANGLE
end

Instance Method Details

#apply_to(robot) ⇒ Object



8
9
10
# File 'lib/rubots/command/rotate_to.rb', line 8

def apply_to(robot)
  robot.desired_angle = @angle
end