Class TrophallaxieFourmi

java.lang.Object
fr.formiko.formiko.interfaces.TrophallaxieFourmi
All Implemented Interfaces:
Trophallaxie, Serializable

public class TrophallaxieFourmi extends Object implements Serializable, Trophallaxie
Ant implementation.
Allow an ant to do a trophallaxis
Author:
Hydrolien
See Also:
  • Constructor Details

    • TrophallaxieFourmi

      public TrophallaxieFourmi()
  • Method Details

    • trophallaxie

      public void trophallaxie(Creature c, Creature c2, int foodDonnée)
      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 interface Trophallaxie
      Parameters:
      c - The trophallaxing Creature.
      c2 - The target of the trophallaxie.
      foodDonnée - The amount of food transferred.
    • trophallaxie

      public void trophallaxie(Creature c, int id, int foodDonnée)
      do a trophallaxis to an id
      Specified by:
      trophallaxie in interface Trophallaxie
      Parameters:
      id - The target Creature to fined on the Case.
    • trophallaxer

      public void trophallaxer(Creature c)
      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 interface Trophallaxie
      Parameters:
      c - The creature who whant to give food.
    • getCreatureQuiOnFaim

      public int[] getCreatureQuiOnFaim(int[] t, Creature net)
      find hungry ant.
      Specified by:
      getCreatureQuiOnFaim in interface Trophallaxie
      Parameters:
      t - The id list of the ant.
      net - The creature who whant to give food.