Package fr.formiko.formiko.interfaces
Class TourInsecte
java.lang.Object
fr.formiko.formiko.interfaces.TourInsecte
- All Implemented Interfaces:
Tour
,Serializable
Insect implementation.
Allow an insect to play a turn.
All insects can extends this class to modify runAway(), eat() or reproduce()
Allow an insect to play a turn.
All insects can extends this class to modify runAway(), eat() or reproduce()
- Author:
- Hydrolien
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
-
Field Details
-
c
-
-
Constructor Details
-
TourInsecte
public TourInsecte()
-
-
Method Details
-
unTour
PLay 1 turn with Creature c. -
tour
public void tour()Play a turn as an Insecte.
Turn work like this :
- Eat if the creature is starving.
- Run away from predator.
- Eat if the creature is hungry.
- Try to fined an other creature to reproduce.
- Eat if the creature is not full.
- End turn.
-
endTurn
End a turn as an Insecte. -
reproduce
private void reproduce()reproduce.
-