|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbecker.robots.Sim
becker.robots.Robot
becker.robots.RobotSE
StudentDriver
public class StudentDriver
This class provides support for the Drivers' Ed project found here.
Constructor Summary | |
---|---|
StudentDriver(Annex c,
int s,
int a,
becker.robots.Direction d,
int f,
double speed,
java.lang.String name,
java.lang.String imageFile)
The constructor passes on the first five parameters to its superclass before preserving the Annex object in one of its instance fields, setting its speed (in moves per second) to the value of the sixth parameter, preserving the driver's name in another instance field, before finally setting its icon to the CarIcon using the supplied image file name. |
Method Summary | |
---|---|
protected becker.robots.Thing |
makeThing(int n,
int total)
In order to ensure the liters of fuel are depicted as Things with a dark gray CircleIcon of size 0.05 it is necessary to override Thing's makeThing(int n, int total) method. |
void |
move()
Drops a liter of fuel on each intersection prior to moving to the next intersection. |
void |
run()
Called by the Thread object. |
Methods inherited from class becker.robots.RobotSE |
---|
countThingsInBackpack, isBesideThing, isFacingEast, isFacingNorth, isFacingSouth, isFacingWest, move, pickAllThings, pickAllThings, pickThing, pickThing, putAllThings, putAllThings, putThing, putThing, save, turnAround, turnLeft, turnRight, turnRight |
Methods inherited from class becker.robots.Robot |
---|
breakRobot, canPickThing, countThingsInBackpack, examineLights, examineRobots, examineThings, examineThings, frontIsClear, getAvenue, getDirection, getIntersection, getLabel, getSpeed, getStreet, getTransparency, pickThing, putThing, setLabel, setSpeed, setTransparency, toString, turnLeft |
Methods inherited from class becker.robots.Sim |
---|
getCity, getColor, getIcon, keyTyped, 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 |
---|
public StudentDriver(Annex c, int s, int a, becker.robots.Direction d, int f, double speed, java.lang.String name, java.lang.String imageFile)
c
- the Annex objects
- the initial streeta
- the initial avenued
- the initial directionf
- the number of liters of fuel (Things)speed
- the initial speed to be assigned to the objectname
- the name of the Georgian driverimageFile
- the file name of the Icon for this StudentDriver objectMethod Detail |
---|
protected becker.robots.Thing makeThing(int n, int total)
makeThing
in class becker.robots.Robot
public void run()
run
in interface java.lang.Runnable
public void move()
move
in class becker.robots.Robot
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |