|
||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.ObjectGrass
This is a simple Critter implementation.
| Constructor Summary | |
Grass()
Initialize and remember the CritterInfo for this Critter. |
|
| Method Summary | |
CritterInfo |
getCritterInfo()
This method returns the CritterInfo object that is storing information about this Critter. |
CritterFace |
getFace(int w,
int h)
This method returns a CritterFace (a displayable collection of Shapes) that can be used to represent this Critter in a MatrixView. |
Critter |
reproduce()
This method creates another object of the same type as this Critter. |
int[] |
selectNextCell(MatrixModel model,
int[] curLoc)
This method implements the logic of this Critter that decides where it wants to move to next. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Grass()
| Method Detail |
public int[] selectNextCell(MatrixModel model,
int[] curLoc)
Critter
selectNextCell in interface Crittermodel - the MatrixModel that this Critter inhabitscurLoc - a 2-element int array containing the current cell location
of this Critter. The row address is in element [0] and
the column address is in element [1].
Critter.selectNextCell(MatrixModel, int[])
public CritterFace getFace(int w,
int h)
Critter
getFace in interface Critterw - the width in pixels of the space the Shapes will
occupy on screenh - the height in pixels of the space the Shapes will
occupy on screen
Critter.getFace(int, int)public Critter reproduce()
Critter
reproduce in interface CritterCritter.reproduce()public CritterInfo getCritterInfo()
Critter
getCritterInfo in interface CritterCritter.getCritterInfo()
|
||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||