|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uwcse.sim.OilThing | +--uwcse.sim.Fish
Fish swim around at random, eating algae and reproducing.
Field Summary | |
protected int |
algaeEaten
How many algae eaten. |
Fields inherited from class uwcse.sim.OilThing |
alive, rand, world, x, y |
Constructor Summary | |
Fish(WorldModel wm,
int x,
int y)
Create a new fish at this location. |
Method Summary | |
void |
action()
Move around at random, eating algae, and reproducing when 4 or more algae have been eaten. |
void |
displayOn(uwcse.graphics.GWindow g)
Display a yellow oval. |
void |
interact(OilThing t)
Kill algae, and keep track of it. |
Methods inherited from class uwcse.sim.OilThing |
checkNeighbors, getX, getY, isAlive, kill, toString |
Methods inherited from class java.lang.Object |
|
Field Detail |
protected int algaeEaten
Constructor Detail |
public Fish(WorldModel wm, int x, int y)
Method Detail |
public void displayOn(uwcse.graphics.GWindow g)
displayOn
in class OilThing
public void action()
action
in class OilThing
public void interact(OilThing t)
interact
in class OilThing
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |