|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--Road
This class models a roadway in our scene.
| Constructor Summary | |
Road(int x,
int y,
int width,
int height,
boolean east_west,
int speedLimit)
Construct the surface and the centerline of the road given the parameters. |
|
| Method Summary | |
void |
addTo(uwcse.graphics.GWindow g)
Add the elements of this display object to the graphics window. |
void |
changeNumberOfCarsBy(int number)
Change the number of Cars traveling on this Road by the given number |
int |
getHeight()
Return the y-span of the Road. |
int |
getNumberOfCars()
Return the number of Cars traveling on this Road |
int |
getSpeedLimit()
Return the speed limit in pixels per tick for Cars on this Road |
uwcse.graphics.Shape |
getSurface()
Return the Shape avatar of the Road. |
int |
getWidth()
Return the x-span of the Road. |
int |
getX()
Return the x-coordinate of the upper left corner of the Road. |
int |
getY()
Return the y-coordinate of the upper left corner of the Road. |
void |
removeFromWindow()
Remove the elements of this display object from the graphics window. |
boolean |
roadIsEastWest()
Return a boolean regarding orientation of the Road |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Road(int x,
int y,
int width,
int height,
boolean east_west,
int speedLimit)
x - the x-coordinate of the upper left corner of the roady - the y-coordinate of the upper left corner of the roadwidth - the x-axis span of the roadheight - the y-axis span of the roadeast_west - the direction of the road; true means East-West, false means North-SouthspeedLimit - the integer speed limit for Cars on this Road in pixels per clock tick| Method Detail |
public void addTo(uwcse.graphics.GWindow g)
addTo in interface uwcse.animation.Propg - the graphics window to usepublic void removeFromWindow()
removeFromWindow in interface uwcse.animation.Proppublic int getX()
public int getY()
public int getHeight()
public int getWidth()
public uwcse.graphics.Shape getSurface()
public boolean roadIsEastWest()
public int getSpeedLimit()
public int getNumberOfCars()
public void changeNumberOfCarsBy(int number)
number - the integer # of Cars by which to change this Road's population
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||