darwin.domain
Interface Creature

All Known Implementing Classes:
MyCreature

public interface Creature

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

getDirection

public Direction getDirection()
Determine the current Direction of this Creature.

Returns:
the current Direction of this Creature.

getNextInstruction

public Instruction getNextInstruction()
Determine the next Instruction to execute for this Creature.

Returns:
the next Instruction to execute for this Creature.

getPosition

public java.awt.Point getPosition()
Determine the current position of this Creature.

Returns:
the current position of this Creature.

getSpecies

public Species getSpecies()
Determine the Species of this Creature.

Returns:
the Species of this Creature.

setNextStep

public void setNextStep(int aNextStep)
Sets the next program step of this Creature.

Parameters:
aNextStep - the next program step for this creature. 1 <= aNextStep <= getSpecies().getProgramSize().

setSpecies

public void setSpecies(Species aSpecies)
Set the Species of this Creature.

Parameters:
aSpecies - the Species for this Creature.

takeOneTurn

public void takeOneTurn()
Execute steps from the Creature's Program until a hop, left, right, or infect instruction is executed.