|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectWatorWorld.Actor
WatorWorld.Shark
public class Shark
A class to model a Shark in the Wator simulation.
Constructor Summary | |
---|---|
Shark()
Create a new shark. |
Method Summary | |
---|---|
void |
act()
Check if starve then if not, act to move and breed if time. |
static int |
getBreedTime()
|
char |
getChar()
Return the character for Sharks. |
static int |
getNumSharks()
Returns the current number of sharks. |
static Color |
getStandardSharkColor()
|
static int |
getStarveTime()
|
static void |
resetNumSharks()
Reset number of sharks to 0. |
static void |
setBreedTime(int newBreedTime)
Change the base number of turns before sharks can breed |
static void |
setStarveTime(int newStarveTime)
Change the base number of turns a shark must eat within or starve |
Methods inherited from class WatorWorld.Actor |
---|
getColor, getDirection, getGrid, getLocation, isEdible, moveTo, putSelfInGrid, removeSelfFromGrid, setColor, setDirection, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Shark()
Method Detail |
---|
public static int getNumSharks()
public static void resetNumSharks()
public static void setBreedTime(int newBreedTime)
newBreedTime
- new number of turns. Must be > 0.public static void setStarveTime(int newStarveTime)
newStarveTime
- new number of turns. Must be > 0public static int getStarveTime()
public static int getBreedTime()
public static Color getStandardSharkColor()
public void act()
act
in class Actor
public char getChar()
getChar
in class Actor
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |