Class: Robot::Simulator::UI::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/robot/simulator/ui/cli.rb

Instance Method Summary collapse

Instance Method Details

#start_gameObject



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/robot/simulator/ui/cli.rb', line 11

def start_game
  @controller = Controller.new

  if options[:file]
    commands = read_commands_from_file options[:file]
  else
    commands = read_commands_from_console
  end

  commands.each {|command| dispatch_command command }
end