Class GCreature

java.lang.Object
fr.formiko.usual.structures.listes.Liste<Creature>
fr.formiko.formiko.GCreature
All Implemented Interfaces:
Serializable, Cloneable, Iterable<Creature>, Collection<Creature>, List<Creature>

public class GCreature extends fr.formiko.usual.structures.listes.Liste<Creature> implements Serializable, Cloneable
List of creatures. lastEditedVersion 2.23
Author:
Hydrolien
See Also:
  • Field Details

    • loopSafety

      private byte loopSafety
  • Constructor Details

    • GCreature

      public GCreature()
      Main constructor.
    • GCreature

      public GCreature(int nbrDeCreature, Fourmiliere fere, Espece e, CCase cc)
      Constructor that create an empty GCreature and then fill it as a Fourmiliere.
  • Method Details

    • getReine

      public Fourmi getReine()
      {summary Return the 1a queen of the anthill} ,or null if there is no qeen.
    • getGcStade

      public GCreature getGcStade(int stade)
      {summary Return all the Creature at a specific stade.}
      Parameters:
      stade - the specific stade to fined
    • getGcType

      public GCreature getGcType(int typeF)
      {summary Return all the Ant at a specific typeF.}
      Parameters:
      typeF - the specific typeF to fined
    • getBrood

      public GCreature getBrood()
      {summary Return all the Creature at an other stade than 0.}
    • getBroodSaleE

      public Creature getBroodSaleE() throws fr.formiko.usual.exceptions.EmptyListException
      Throws:
      fr.formiko.usual.exceptions.EmptyListException
    • getBroodSale

      public Creature getBroodSale()
    • getBroodsSale

      public GCreature getBroodsSale()
    • getCreatureByIdE

      private Creature getCreatureByIdE(int id) throws fr.formiko.usual.exceptions.EmptyListException
      return the Creature that have this id.
      Parameters:
      id - the id of the creature
      Throws:
      fr.formiko.usual.exceptions.EmptyListException
    • getCreatureById

      public Creature getCreatureById(int id)
      return the Creature that have this id.
      Parameters:
      id - the id of the creature
    • getFourmiById

      public Fourmi getFourmiById(int id)
      return the Fourmi that have this id.
      If the creature isn't an Ant it return null & print an error.
      Parameters:
      id - the id of the Fourmi.
    • getFourmiParFereE

      private Fourmi getFourmiParFereE(Fourmiliere fere) throws fr.formiko.usual.exceptions.EmptyListException
      Throws:
      fr.formiko.usual.exceptions.EmptyListException
    • getFourmiParFere

      public Fourmi getFourmiParFere(Fourmiliere fere)
    • toGc

      private static GCreature toGc(fr.formiko.usual.structures.listes.Liste<Creature> l)
      Return a list with all this class functions.
    • filterAlliés

      private GCreature filterAlliés(Creature cTested, int differenceTolerated)
      Return the Creatures that are ally with c.
      Parameters:
      cTested - the tested creature
      differenceTolerated - the Pheromone difference that is tolerated
    • filterAlliés

      public GCreature filterAlliés(Creature c)
      return the Creatures that are ally with c.
      Parameters:
      c - the tested creature.
    • filterFaimMax

      public GCreature filterFaimMax()
      delete Creature that can't eat more.
    • filterHealthMax

      public GCreature filterHealthMax()
      delete Creature that can't be cleaner.
    • filterWantFood

      public GCreature filterWantFood()
      delete Creature that didn't whant food.
    • filterWantClean

      public GCreature filterWantClean()
      delete Creature that didn't whant clean.
    • setLienFere

      public void setLienFere(Fourmiliere fere)
    • getNbrGcStade

      public int getNbrGcStade(int x)
    • getNbrImago

      public int getNbrImago()
    • getNbrReine

      public int getNbrReine()
    • getNbrOuvriere

      public int getNbrOuvriere()
      Count worker imago. Worker imago are at stade 0 and type 3, 4 or 5.
    • getEspece

      public Espece getEspece()
      Return species of this GCreature as if it was the gc of an anthill.
    • gcToTInt

      public int[] gcToTInt()
      Return an array of id.
    • copier

      public GCreature copier()
    • getGi

      public GInsecte getGi()
      Return all Insecte from this.
    • jouerE

      private void jouerE() throws fr.formiko.usual.exceptions.EmptyListException
      Play as an ant. If antIdToPlay have been set, we will play this ant first.
      Throws:
      fr.formiko.usual.exceptions.EmptyListException
    • jouer

      public void jouer()
      Play as an ant.
    • preTurnE

      private void preTurnE() throws fr.formiko.usual.exceptions.EmptyListException
      reset action before the turn of all the ant.
      Throws:
      fr.formiko.usual.exceptions.EmptyListException
    • preTurn

      public void preTurn()
      reset action before the turn of all the ant.
    • updateCaseSN

      public void updateCaseSN()
      Update Black and cloud Case.
    • classerPourNetoyage

      public void classerPourNetoyage(Fourmi f)
      Sort this depending of health.
    • toTId

      public int[] toTId()
    • haveDoneAllActionAviable

      public boolean haveDoneAllActionAviable()
      Return true if all Creature have played to there last action. Action can be under 0.
    • isAllInAutoMode

      public boolean isAllInAutoMode()
      Return true if all ant are in autoMode.
    • isAllInAutoModeOrHaveDoneAllAction

      public boolean isAllInAutoModeOrHaveDoneAllAction()
      Return true if all ant are in autoMode.
    • setAction0AndEndTurn

      public boolean setAction0AndEndTurn()
      Force all the GCreature Creature to end there turn.
      Ant that still haven't end there turn will have action set to 0 & tour to update age, cleaning etc.