Class: Rubots::Command::RotateGunTo
- Defined in:
- lib/rubots/command/rotate_gun_to.rb
Instance Method Summary collapse
- #apply_to(robot) ⇒ Object
-
#initialize(angle) ⇒ RotateGunTo
constructor
A new instance of RotateGunTo.
Methods inherited from Base
Constructor Details
#initialize(angle) ⇒ RotateGunTo
Returns a new instance of RotateGunTo.
4 5 6 |
# File 'lib/rubots/command/rotate_gun_to.rb', line 4 def initialize(angle) @angle = angle % Robot::MAX_GUN_ANGLE end |
Instance Method Details
#apply_to(robot) ⇒ Object
8 9 10 |
# File 'lib/rubots/command/rotate_gun_to.rb', line 8 def apply_to(robot) robot.desired_gun_angle = @angle end |