|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectWatorWorld.Actor
WatorWorld.Fish
public class Fish
A class to model a Fish in the Wator simulation.
Constructor Summary | |
---|---|
Fish()
Create a new Fish. |
Method Summary | |
---|---|
void |
act()
Act to move if possible and then breed if time. |
static int |
getBreedTime()
|
char |
getChar()
Return the character for Fish. |
static int |
getNumFish()
Return the total number of fish that exist. |
static Color |
getStandardFishColor()
Get the standard Fish Color. |
boolean |
isEdible()
Return if edible, which for fish is true. |
void |
removeSelfFromGrid()
Remove my self from the grid and decrement the total number of fish. |
static void |
resetNumFish()
Reset number of fish to zero. |
static void |
setBreedTime(int newBreedTime)
Change the number of turns before a fish can breed. |
Methods inherited from class WatorWorld.Actor |
---|
getColor, getDirection, getGrid, getLocation, moveTo, putSelfInGrid, setColor, setDirection, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Fish()
Method Detail |
---|
public static void setBreedTime(int newBreedTime)
newBreedTime
- parmater must be greater than 0.public static int getNumFish()
public static void resetNumFish()
public static Color getStandardFishColor()
public static int getBreedTime()
public void act()
act
in class Actor
public char getChar()
getChar
in class Actor
public void removeSelfFromGrid()
removeSelfFromGrid
in class Actor
public boolean isEdible()
isEdible
in class Actor
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |