|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object A4Shell.Actor A4Shell.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. |
char |
getChar()
Return the character for Fish. |
java.awt.Color |
getColor()
Get the color for this Fish. |
static int |
getNumFish()
Return the total number of fish that exist. |
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 A4Shell.Actor |
---|
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 void act()
act
in class Actor
public char getChar()
getChar
in class Actor
public void removeSelfFromGrid()
removeSelfFromGrid
in class Actor
public java.awt.Color getColor()
getColor
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 |