Package fr.formiko.formiko.interfaces
Class TrophallaxieFourmi
java.lang.Object
fr.formiko.formiko.interfaces.TrophallaxieFourmi
- All Implemented Interfaces:
Trophallaxie
,Serializable
Ant implementation.
Allow an ant to do a trophallaxis
Allow an ant to do a trophallaxis
- Author:
- Hydrolien
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint[]
getCreatureQuiOnFaim
(int[] t, Creature net) find hungry ant.void
player trophallaxisvoid
trophallaxie
(Creature c, int id, int foodDonnée) do a trophallaxis to an idvoid
trophallaxie
(Creature c, Creature c2, int foodDonnée) make a trophallaxis.
-
Constructor Details
-
TrophallaxieFourmi
public TrophallaxieFourmi()
-
-
Method Details
-
trophallaxie
make a trophallaxis.
This methode will check that no food will be lost and no food will be create.
If the trophallaxis work well it will cost action to the 2 creatures.- Specified by:
trophallaxie
in interfaceTrophallaxie
- Parameters:
c
- The trophallaxing Creature.c2
- The target of the trophallaxie.foodDonnée
- The amount of food transferred.
-
trophallaxie
do a trophallaxis to an id- Specified by:
trophallaxie
in interfaceTrophallaxie
- Parameters:
id
- The target Creature to fined on the Case.
-
trophallaxer
player trophallaxis
1a find the target ant that can be chose & make the player chose 1.
2a ask the amount of food transferred by the player.
3a do the trophallaxis.- Specified by:
trophallaxer
in interfaceTrophallaxie
- Parameters:
c
- The creature who whant to give food.
-
getCreatureQuiOnFaim
find hungry ant.- Specified by:
getCreatureQuiOnFaim
in interfaceTrophallaxie
- Parameters:
t
- The id list of the ant.net
- The creature who whant to give food.
-