Package fr.formiko.formiko.interfaces
Class TourReine
java.lang.Object
fr.formiko.formiko.interfaces.TourFourmi
fr.formiko.formiko.interfaces.TourReine
- All Implemented Interfaces:
Tour
,Serializable
Ant implementation.
Allow an ant to play a turn
Allow an ant to play a turn
- Author:
- Hydrolien
- See Also:
-
Field Summary
Fields inherited from class fr.formiko.formiko.interfaces.TourFourmi
f
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Check if this ant have some help from other ant of the same anthill.void
lay()
Lay egg as a queen ant.boolean
Check if this ant need to feed/protect/clean some egg, larva or nympha.boolean
Wait to be the last ant to play.void
tour()
Do turn actions for a queen ant.Methods inherited from class fr.formiko.formiko.interfaces.TourFourmi
aNetoyer, aNourrir, backHome, backHomeAndShareFood, cleanItself, cleanOther, endTurn, endTurn, feedOther, setF, unTour
-
Constructor Details
-
TourReine
public TourReine()
-
-
Method Details
-
tour
public void tour()Do turn actions for a queen ant.- 1a the ant try to survive.
- If the ant is alone, it try to get more food.
- If some other ant (of the same anthill) haven't played yet, it wait that they have. This allow the queen to lay more egg only if every other ant are clean and well feed.
- Then it help any friendly ant in the anthill place.
- Finaly it lay more egg.
- Overrides:
tour
in classTourFourmi
-
needToWaitToLetNonQueenAntPlay
public boolean needToWaitToLetNonQueenAntPlay()Wait to be the last ant to play.
The queen whait util all the ant that did'nt have this implementation have played -
haveSomeHelp
public boolean haveSomeHelp()Check if this ant have some help from other ant of the same anthill. -
needToTakeCareOfBrood
public boolean needToTakeCareOfBrood()Check if this ant need to feed/protect/clean some egg, larva or nympha. -
lay
public void lay()Lay egg as a queen ant.
If the queen have no help from al list 1 ally imago ant, it don't lay more than 1 egg.
-