darwin.domain
Class MyCreature
java.lang.Object
darwin.domain.MyCreature
- All Implemented Interfaces:
- Creature
- public class MyCreature
- extends java.lang.Object
- implements Creature
This class represents one creature in the world. Each creature must remember
its species, position, direction, and the world in which it is living.
In addition, the Creature must remember the next instruction out of its
program to execute.
Constructor Summary |
MyCreature(Species aSpecies,
World aWorld,
java.awt.Point aPosition,
Direction aDirection)
Create a MyCreature of the given Species, with the indicated position and
direction. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MyCreature
public MyCreature(Species aSpecies,
World aWorld,
java.awt.Point aPosition,
Direction aDirection)
- Create a MyCreature of the given Species, with the indicated position and
direction. Note that we also pass in the World-- remember this World, so
that you can check what is in front of the creature and to update the
world when the creature moves.