|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface represents one creature in the Darwin world. Each Creature must know its position, direction, and the Program of its Species.
Method Summary | |
Direction |
getDirection()
Determine the current Direction of this Creature. |
Instruction |
getNextInstruction()
Determine the next Instruction to execute for this Creature. |
java.awt.Point |
getPosition()
Determine the current position of this Creature. |
Species |
getSpecies()
Determine the Species of this Creature. |
void |
setNextStep(int aNextStep)
Sets the next program step of this Creature. |
void |
setSpecies(Species aSpecies)
Set the Species of this Creature. |
void |
takeOneTurn()
Execute steps from the Creature's Program until a hop, left, right, or infect instruction is executed. |
Method Detail |
public Direction getDirection()
public Instruction getNextInstruction()
public java.awt.Point getPosition()
public Species getSpecies()
public void setNextStep(int aNextStep)
aNextStep
- the next program step for this creature. 1 <= aNextStep <=
getSpecies().getProgramSize().public void setSpecies(Species aSpecies)
aSpecies
- the Species for this Creature.public void takeOneTurn()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |