Class ChasseGranivore

java.lang.Object
fr.formiko.formiko.interfaces.ChasseGranivore
All Implemented Interfaces:
Chasse, Serializable

public class ChasseGranivore extends Object implements Serializable, Chasse
Ant implementation.
Allow an ant to do hunt
Ant are able to see other ObjetSurCarteAId as Creature at 1 Case of distance.
Author:
Hydrolien
See Also:
  • Field Details

  • Constructor Details

    • ChasseGranivore

      public ChasseGranivore(Creature c)
  • Method Details

    • chasser

      public boolean chasser(Creature c, int direction)
      collect seeds.
      Ant search a seed. If it see a seed on the same Case it take it. If it see a seed on an other Case it goes to the Case.
      It can choose the first 1 or the better 1 depending on the difficulty.
      Specified by:
      chasser in interface Chasse
      Parameters:
      c - The collecting ant.
    • chasse

      public boolean chasse(Creature c)
      actions during hunt.
      Ant search a Seed in the same Case
      It can choose the first 1 or the better 1 depending on the difficulty.
      Specified by:
      chasse in interface Chasse
      Parameters:
      c - The hunting Creature. return true if c can hunt more.
    • getProie

      private GGraine getProie()
      fined a prey.
    • canHuntMore

      public boolean canHuntMore()
    • canHuntMore

      public boolean canHuntMore(Creature c)
      Check if can hunt.
      It should use Chasse.canHuntMore & specifics conditions for granivore species.
      Specified by:
      canHuntMore in interface Chasse
    • eatIfNeed

      private boolean eatIfNeed()
    • havePreyOnSameSquare

      public boolean havePreyOnSameSquare(Creature c)
      Return true if there is prey on same square.
      Specified by:
      havePreyOnSameSquare in interface Chasse
    • eatSeed

      public void eatSeed()
      Eat the transported seed.
      Specified by:
      eatSeed in interface Chasse
    • breakSeed

      public void breakSeed()
      Break the transported seed.
      Specified by:
      breakSeed in interface Chasse
    • canEatSeed

      public boolean canEatSeed()
      Return true if Creature can eat the transported seed.
      Specified by:
      canEatSeed in interface Chasse
    • canBreakSeed

      public boolean canBreakSeed()
      Return true if Creature can break the transported seed.
      Specified by:
      canBreakSeed in interface Chasse