cs1705
Class Robot

java.lang.Object
  extended by java.util.Observable
      extended by kareltherobot.ur_Robot
          extended by kareltherobot.Robot
              extended by cs1705.Robot
All Implemented Interfaces:
Runnable, kareltherobot.Directions
Direct Known Subclasses:
TestableRobot

public class Robot
extends kareltherobot.Robot

This class is a simple wrapper for Bergin's Robot. Please use VPIRobot instead of this class. This class is provided purely for compatibility with the examples in Bergin's text, so that if a student accidentally types in code nearly verbatim from the book, it will still work as expected.

Version:
2003.08.20
Author:
Stephen Edwards

Nested Class Summary
 
Nested classes/interfaces inherited from class kareltherobot.ur_Robot
kareltherobot.ur_Robot.ConnectStrategy
 
Nested classes/interfaces inherited from interface kareltherobot.Directions
kareltherobot.Directions.Direction
 
Field Summary
 
Fields inherited from interface kareltherobot.Directions
East, EastVal, infinity, North, NorthVal, South, SouthVal, West, WestVal
 
Constructor Summary
Robot(int street, int avenue, kareltherobot.Directions.Direction direction, int numberOfBeepers)
          Constructor which supports the specific placement, orientation and setting the number of beepers for Karel.
 
Method Summary
 
Methods inherited from class kareltherobot.Robot
anyBeepersInBeeperBag, facingEast, facingNorth, facingSouth, facingWest, frontIsClear, nextToABeeper, nextToARobot
 
Methods inherited from class kareltherobot.ur_Robot
acceptConnection, acceptConnectionFrom, areYouHere, avenue, connectTo, direction, getNextCommunication, isVisible, move, neighbors, pickBeeper, putBeeper, restoreInitialState, run, running, send, setVisible, showState, street, toString, turnLeft, turnOff, waitForCommunication, waitForNextCommunication
 
Methods inherited from class java.util.Observable
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Robot

public Robot(int street,
             int avenue,
             kareltherobot.Directions.Direction direction,
             int numberOfBeepers)
Constructor which supports the specific placement, orientation and setting the number of beepers for Karel. Karel is placed at the intersection of the specified street and avenue, facing in the specified direction and holding the specified number of beepers in the beeper bag.

Parameters:
street - street number of Karel's placement
avenue - avenue number of Karel's placement
direction - the direction Karel is pointing in (North, East, South, West)
numberOfBeepers - number of beepers in the beeper bag (>= 0)