becker.robots
Class RobotRC

java.lang.Object
  extended by becker.robots.Sim
      extended by becker.robots.Robot
          extended by becker.robots.RobotRC
All Implemented Interfaces:
IColor, ILabel

public class RobotRC
extends Robot

A Remote Control Robot, RobotRC for short, can be directed from a computer keyboard. The city's view must have the keyboard focus when the program is running for the robot to receive the instructions from the keyboard. When the city's view has the focus it will have a thin black outline. Shift the focus between the speed control, the start/stop button on the city's view with the tab key.

Author:
Byron Weber Becker

Constructor Summary
RobotRC(City theCity, int street, int avenue, Direction dir)
          Construct a new RobotRC robot with nothing in its backpack.
RobotRC(City theCity, int street, int avenue, Direction dir, int numThings)
          Construct a new RobotRC robot.
 
Method Summary
protected  void keyTyped(char key)
          Respond to the following keys in the given manner: KeysResponse m, Mmove r, Rturn right l, Lturn left u, Upick up a thing d, Dput down a thing
 
Methods inherited from class becker.robots.Robot
breakRobot, canPickThing, countThingsInBackpack, countThingsInBackpack, examineLights, examineRobots, examineThings, examineThings, frontIsClear, getAvenue, getDirection, getIntersection, getLabel, getSpeed, getStreet, getTransparency, isBesideThing, makeThing, move, pickThing, pickThing, pickThing, putThing, putThing, putThing, save, setLabel, setSpeed, setTransparency, toString, turnLeft
 
Methods inherited from class becker.robots.Sim
getCity, getColor, getIcon, notifyObservers, notifyObservers, setColor, setIcon
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface becker.robots.IColor
getColor, setColor
 

Constructor Detail

RobotRC

public RobotRC(City theCity,
               int street,
               int avenue,
               Direction dir,
               int numThings)
Construct a new RobotRC robot.

Parameters:
theCity - the City where the robot will reside.
street - the robot's initial street.
avenue - the robot's initial avenue.
dir - the robot's initial direction.
numThings - the number of things initially in the backpack.

RobotRC

public RobotRC(City theCity,
               int street,
               int avenue,
               Direction dir)
Construct a new RobotRC robot with nothing in its backpack.

Parameters:
theCity - the City where the robot will reside.
avenue - the robot's initial avenue.
street - the robot's initial street.
dir - the robot's initial direction.
Method Detail

keyTyped

protected void keyTyped(char key)
Respond to the following keys in the given manner:
KeysResponse
m, Mmove
r, Rturn right
l, Lturn left
u, Upick up a thing
d, Dput down a thing

Overrides:
keyTyped in class Sim
Parameters:
key - The key typed at the keyboard.