def update(robot, action, state)
return unless state
if action == MOVE_ACTION
register_robot(robot, state)
if $window
sleep(@@delay / 100.0)
$window.move_robot(@@graphical_robots[robot])
end
elsif action == CREATE_ACTION
register_robot(robot, state)
if $window
street, avenue, direction = state[0], state[1], state[2]
@@graphical_robots[robot] = $window.add_robot(street, avenue, direction)
end
elsif action == TURN_LEFT_ACTION
if $window
sleep(@@delay / 100.0)
$window.turn_left_robot(@@graphical_robots[robot])
end
elsif action == TURN_OFF_ACTION
sleep(@@delay / 200.0)
$window.turn_off_robot(@@graphical_robots[robot])
elsif action == PICK_BEEPER_ACTION
elsif action == PUT_BEEPER_ACTION
else
end
@robots[robot] = state
end