|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
This interface describes the methods that a MatrixModel creature must implement.
| 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. |
| Method Detail |
public int[] selectNextCell(MatrixModel model,
int[] curLoc)
model - 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].
MatrixModel.getCritter(int[])
public CritterFace getFace(int w,
int h)
w - 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
public CritterInfo getCritterInfo()
public Critter reproduce()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||