Class DeplacementFourmi

java.lang.Object
fr.formiko.formiko.interfaces.DeplacementFourmi
All Implemented Interfaces:
Deplacement, Serializable

public class DeplacementFourmi extends Object implements Serializable, Deplacement
Ant implementation.
Allow an ant to moove
Author:
Hydrolien
See Also:
  • Field Details

  • Constructor Details

    • DeplacementFourmi

      public DeplacementFourmi()
  • Method Details

    • unMouvement

      public void unMouvement(Creature c, boolean bIa)
      make a move.
      Specified by:
      unMouvement in interface Deplacement
      Parameters:
      c - the moving Creature.
      bIa - Is c moved by an AI or a player.
    • unMouvement

      public void unMouvement(Creature c, Case p)
      make a move to a defined Case.
      c will move 1 Case closer to p but maybe p is more than 1 Case longer to c.getCCase()
      c will move by the unMouvement(c,direction) methode.
      Specified by:
      unMouvement in interface Deplacement
      Parameters:
      c - the moving Creature.
      p - the Case were c want to go.
    • unMouvement

      public void unMouvement(Creature c, CCase cc)
      make a move to a defined Case.
      c will move 1 Case closer to p but maybe p is more than 1 Case longer to c.getCCase()
      c will move by the unMouvement(c,direction) methode.
      Specified by:
      unMouvement in interface Deplacement
      Parameters:
      c - the moving Creature.
      cc - the CCase were c want to go.
    • unMouvement

      public void unMouvement(Creature c, int direction)
      make a moove in a defined direction.
      c will move 1 Case closer to p but maybe p is more than 1 Case longer to c.getCCase()
      Specified by:
      unMouvement in interface Deplacement
      Parameters:
      c - the moving Creature.
      direction - the direction to move. (It's a number place as on the keyboard 1= North West, 2 = North, etc)
    • plusieurMouvement

      public void plusieurMouvement(Creature c, CCase cc)
      make as much moove as we can/need to a defined Case.
      c will stop moving when it will have reach cc or when it actions will be < 0 c will move by the unMouvement(c,cc) methode.
      Specified by:
      plusieurMouvement in interface Deplacement
      Parameters:
      c - the moving Creature.
      cc - the CCase were c want to go.
    • unMouvementAllĂ©a

      private void unMouvementAllĂ©a()
      make a random moove.
    • unMouvementVolontaire

      private void unMouvementVolontaire(int direction)
      make a willing moove.
      Parameters:
      direction - the direction to move. (It's a number place as on the keyboard 1= North West, 2 = North, etc)
    • setActionMoinsDĂ©placement

      private void setActionMoinsDĂ©placement()
      remove some action to the moving Creature
      It will remove 10 action to a non-ant Creature or the individu cost to an ant.
    • unPas

      private boolean unPas(int d)
      Move to a next Case.
    • unPas

      private boolean unPas(CCase p)
      Move to a next Case.
      All moving thing use this methode to move.