Class Case

java.lang.Object
fr.formiko.formiko.Case
All Implemented Interfaces:
Serializable

public class Case extends Object implements Serializable
Square objects use to represent the map.
Author:
Hydrolien
See Also:
  • Field Details

    • p

      private fr.formiko.usual.Point p
    • type

      private byte type
      1=grass, 2=moss, 3=sand
    • fere

      private Fourmiliere fere
    • gc

      private GCreature gc
    • gg

      private GGraine gg
    • gb

      private transient GBlade gb
    • foodInsecte

      private byte foodInsecte
    • foodInsecteMax

      private byte foodInsecteMax
    • foodInsecteParTour

      private byte foodInsecteParTour
  • Constructor Details

    • Case

      public Case(fr.formiko.usual.Point p, Fourmiliere fere, GCreature gc, byte foodInsecte, byte foodInsecteMax, byte nt)
    • Case

      public Case(fr.formiko.usual.Point p, Fourmiliere fere, GCreature gc)
    • Case

      public Case(fr.formiko.usual.Point p)
    • Case

      public Case(int x, int y)
  • Method Details

    • getP

      public fr.formiko.usual.Point getP()
    • getPoint

      public fr.formiko.usual.Point getPoint()
    • setP

      public void setP(fr.formiko.usual.Point p)
    • getX

      public int getX()
    • getY

      public int getY()
    • getFere

      public Fourmiliere getFere()
    • setFere

      public void setFere(Fourmiliere fere)
    • getGc

      public GCreature getGc()
    • setGc

      public void setGc(GCreature gc)
    • getGi

      public GInsecte getGi()
    • getFoodInsecte

      public byte getFoodInsecte()
    • setFoodInsecte

      public void setFoodInsecte(byte x)
      Update to x foodInsecte. It also update GBlade if needed.
      Parameters:
      x - new foodInsecte
    • setFoodInsecte

      public void setFoodInsecte(int x)
    • addFoodInsecte

      public void addFoodInsecte(byte x)
      Add x foodInsecte. It also update GBlade if needed.
      Parameters:
      x - foodInsecte to add
    • addFoodInsecte

      public void addFoodInsecte(int x)
    • removeFoodInsecte

      public void removeFoodInsecte(byte x)
      remove x foodInsecte. It also update GBlade if needed.
      Parameters:
      x - foodInsecte to remove
    • removeFoodInsecte

      public void removeFoodInsecte(int x)
    • getFoodInsecteMax

      public byte getFoodInsecteMax()
    • setFoodInsecteMax

      public void setFoodInsecteMax(byte x)
    • getFoodInsecteParTour

      public byte getFoodInsecteParTour()
    • setFoodInsecteParTour

      public void setFoodInsecteParTour(byte x)
    • getGGraineCopier

      public GGraine getGGraineCopier()
    • getGGraine

      public GGraine getGGraine()
    • getGg

      public GGraine getGg()
    • getGb

      public GBlade getGb()
    • getType

      public byte getType()
    • setType

      public void setType(byte type)
      Update type & GBlade depending of type.
      Parameters:
      type - the type to set
    • setType

      public void setType(int x)
    • canReachCase

      public boolean canReachCase()
    • toString

      public String toString()
      Return a string that describe this.
      Overrides:
      toString in class Object
    • toStringShort

      public String toStringShort()
      Return a short string that describe this.
    • desc

      public String desc()
    • getNbrDElementSurCase

      public int getNbrDElementSurCase()
      Returns The number of element on this..
      Returns:
      The number of element on this.
    • length

      public int length()
      Returns The number of element on this..
      Returns:
      The number of element on this.
    • getSortedGc

      public GCreature getSortedGc(Fourmi f)
      Returns The GCreature sorted by friendly level with an ant..
      Parameters:
      f - the ant to compare
      Returns:
      The GCreature sorted by friendly level with an ant.
    • getSortedGc

      public GCreature getSortedGc()
    • equals

      public boolean equals(Object o)
      Standard equals function. Null & other class type proof.
      Overrides:
      equals in class Object
      Parameters:
      o - o is the Object to test. It can be null or something else than this class.
    • estCaseVide

      public boolean estCaseVide()
    • description

      public String description()
    • updateFoodInsecte

      public void updateFoodInsecte()
      Update foodInsecte. It also update GBlade if needed.
    • actualisationGraine

      public void actualisationGraine(CCase p)
    • iniGBlade

      private void iniGBlade()
      Initialize GBlade back.
    • addBlades

      private void addBlades(int nbrBlades)
      Initialize GBlade back.
    • removeBlades

      private void removeBlades(int nbrBlades)
      Initialize GBlade back.
    • interestForHerbivore

      public int interestForHerbivore()
      Give a score about herbivore interest for this square.
      It use 2 parameters, foodInsecte & number of other insect already in it.