|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object SimpleTurtle Turtle Deer
Class that represents a deer. The deer class tracks all living deer with a linked list.
Constructor Summary | |
Deer(int x,
int y,
ModelDisplay modelDisplayer)
Constructor that takes the x and y and a model display to draw it on |
|
Deer(ModelDisplay modelDisplayer)
Constructor that takes the model display (the original position will be randomally assigned |
Method Summary | |
void |
act()
Method to act during a time step pick a random direction and move some random amount up to top speed |
void |
die()
Method that handles when a deer dies |
static Deer |
getHead()
Method to get the head of the linked list of deer |
Deer |
getNext()
Method to get the next Deer in the linked list |
void |
init()
Method to initialize the new deer object |
static void |
main(java.lang.String[] args)
main method for testing |
Methods inherited from class SimpleTurtle |
backward, backward, clearPath, drawInfoString, drop, forward, forward, getBodyColor, getDistance, getHeading, getHeight, getInfoColor, getModelDisplay, getName, getPen, getPenColor, getPenWidth, getPicture, getShellColor, getShowInfo, getWidth, getXPos, getYPos, hide, isPenDown, isVisible, moveTo, paintComponent, penDown, penUp, setBodyColor, setColor, setHeading, setHeight, setInfoColor, setModelDisplay, setName, setPen, setPenColor, setPenDown, setPenWidth, setPicture, setShellColor, setShowInfo, setVisible, setWidth, show, toString, turn, turnLeft, turnRight, turnToFace, turnToFace, updateDisplay |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Deer(ModelDisplay modelDisplayer)
modelDisplayer
- thing which will display the modelpublic Deer(int x, int y, ModelDisplay modelDisplayer)
x
- the starting x positiony
- the starting y positionmodelDisplayer
- the thing that displays the modelMethod Detail |
public static Deer getHead()
public Deer getNext()
public void init()
public void act()
public void die()
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |