class RubyArena::CommandParser
Attributes
actions[R]
Public Class Methods
new()
click to toggle source
# File lib/ruby_arena/command_parser.rb, line 5 def initialize reset_actions end
Public Instance Methods
accelerate()
click to toggle source
# File lib/ruby_arena/command_parser.rb, line 21 def accelerate @actions[:accelerate] = true end
decelerate()
click to toggle source
# File lib/ruby_arena/command_parser.rb, line 25 def decelerate @actions[:decelerate] = true end
fire()
click to toggle source
# File lib/ruby_arena/command_parser.rb, line 29 def fire @actions[:fire] = true end
radar_view_angle(angle)
click to toggle source
# File lib/ruby_arena/command_parser.rb, line 33 def radar_view_angle(angle) @actions[:radar_view_angle] = angle end
reset_actions()
click to toggle source
# File lib/ruby_arena/command_parser.rb, line 37 def reset_actions @actions = {} end
turn(angle)
click to toggle source
# File lib/ruby_arena/command_parser.rb, line 9 def turn(angle) @actions[:turn] = angle end
turn_gun(angle)
click to toggle source
# File lib/ruby_arena/command_parser.rb, line 13 def turn_gun(angle) @actions[:turn_gun] = angle end
turn_radar(angle)
click to toggle source
# File lib/ruby_arena/command_parser.rb, line 17 def turn_radar(angle) @actions[:turn_radar] = angle end