Package fr.formiko.formiko
Class Fourmi
java.lang.Object
fr.formiko.formiko.ObjetAId
fr.formiko.formiko.ObjetSurCarteAId
fr.formiko.formiko.Creature
fr.formiko.formiko.Fourmi
- All Implemented Interfaces:
Serializable
The ant class.
Ant is the creature used by player.
Ant aren't different by extends of this class but by Espece & Individu.
Ant is the creature used by player.
Ant aren't different by extends of this class but by Espece & Individu.
- Author:
- Hydrolien
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprivate static boolean
protected boolean
protected Fourmiliere
protected byte
protected byte
protected byte
It can be 0: ♀, 1: ♂, 2: Minor, 3: Medium (☿), 4:Major, 5:soldier 6+:other type.private static byte
Fields inherited from class fr.formiko.formiko.Creature
action, age, chasse, déplacement, e, evoluer, food, givenFood, health, isDead, maxAction, maxAge, maxFood, mourir, netoyer, ph, pheromoneTolerence, pondre, stade, tour, transported, trophallaxie
Fields inherited from class fr.formiko.formiko.ObjetSurCarteAId
ccase, direction
-
Constructor Summary
ConstructorDescriptionFourmi()
Null constructor.Fourmi
(Fourmiliere fere, Espece e, byte ty) Main constructor.Fourmi
(Fourmiliere fere, Espece e, byte ty, byte stade) Secondary constructor.Fourmi
(Fourmiliere fere, Espece e, byte typeF, byte stade, Pheromone ph) Secondary constructor.Fourmi
(Fourmiliere fere, Espece e, int ty) Secondary constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
fr.formiko.usual.structures.listes.GString
String[]
boolean
True if the ant is at its anthill.boolean
estReine()
static boolean
boolean
boolean
getFere()
int
byte
boolean
return true if Ant still have wings.byte
int
return the max age for an Individu with stade=0 (imago) & individu already define.int
getMaxAgeIndividu
(int especeTempId, int stadeTemp) return the max age for an Individu depending of Espece & stade.byte
getMode()
int
double
return the difficulty multiplier.getName()
getReine()
int
getSex()
int
Return the state of the Fourmi concerning health.boolean
byte
getType()
byte
getTypeF()
static byte
int
getX()
int
getY()
void
Initialize ph value for an ant.void
iniTour()
initialize tour value for an ant.boolean
isAI()
Return true if is own by an AI.boolean
boolean
isImago()
void
salir()
un-clean this.void
setAction
(int x) Update action & update view.static void
setBActionHaveChange
(boolean b) Setter that notify playing ant in case it was waiting for an action to be choose.void
setCutWings
(boolean b) void
setFemelle
(boolean b) void
setFere
(Fourmiliere fere) void
void
void
setHardnessMax
(byte x) void
setMode
(byte x) void
setMode
(int x) void
setTypeF
(byte s) void
setTypeF
(int x) static void
static void
setUneSeuleAction
(int x) toString()
Return a description of the creature.Return a short string that describe this.boolean
return true if this whant to be clean.boolean
wantFood()
return true if this whant some food.Methods inherited from class fr.formiko.formiko.Creature
addFood, ajouteAge, ajouteFood, canLay, ceDeplacer, ceDeplacer, ceDeplacer, ceDeplacer, ceDeplacerPlusieurCase, ceNetoyer, chasse, chasser, diminuerOuPasFood, dropTransported, eat, endTurn, estFourmi, evoluer, friendlyLevel, getAction, getAge, getAlliéSurLaCase, getAlliéSurLaCaseSansThis, getEspece, getEstAllié, getEstEnnemi, getFood, getGivenFood, getHealth, getIa, getIsDead, getIsNeutral, getLastTurnEnd, getMaxAction, getMaxAge, getMaxFood, getMaxHealth, getPh, getPheromone, getPheromoneTolerence, getSize, getStade, getStateAction, getStateAge, getStateFood, getStringStade, getTransported, isDead, isFlying, isHungry, mourir, mourir, mourirOuPas, netoyer, netoyer, netoyerIa, pondre, preTurn, runAway, setActionMoins, setActionTo0, setAge, setAgePlus1, setCCase, setEspece, setEspece, setFood, setFoodMoins1, setGivenFood, setHealth, setHealth, setIsDead, setLastTurnEnd, setMaxAction, setMaxAge, setMaxFood, setPh, setPheromone, setPheromone, setPheromone, setPheromoneTolerence, setStade, setStade, setTransported, supprimerDeLaCarte, tour, trophallaxer, trophallaxie, trophallaxie
Methods inherited from class fr.formiko.formiko.ObjetSurCarteAId
getCase, getCCase, getDirAllea, getDirection, setCc, setCCase, setDirection
-
Field Details
-
typeF
protected byte typeFIt can be 0: ♀, 1: ♂, 2: Minor, 3: Medium (☿), 4:Major, 5:soldier 6+:other type. -
mode
protected byte mode -
fere
-
hardnessMax
protected byte hardnessMax -
uneSeuleAction
private static byte uneSeuleAction -
bActionHaveChange
private static boolean bActionHaveChange -
cutWings
protected boolean cutWings
-
-
Constructor Details
-
Fourmi
Main constructor.
By default the ant is an egg of 0 years old & 100/100 of cleaning Pheromone are set depending of the queen of the anthill.- Parameters:
fere
- The anthill of this.e
- The specie of this.ty
- The typeF of this. It can be 0: ♀, 1: ♂, 2: Minor, 3: Medium (☿), 4:Major, 5:soldier 6+:other type.
-
Fourmi
Secondary constructor.- Parameters:
fere
- The anthill of this.e
- The specie of this.ty
- The typeF of this. It can be 0: ♀, 1: ♂, 2: Minor, 3: Medium, 4:Major, 5:soldier 6+:other type.
-
Fourmi
Secondary constructor.- Parameters:
fere
- The anthill of this.e
- The specie of this.ty
- The typeF of this. It can be 0: ♀, 1: ♂, 2: Minor, 3: Medium, 4:Major, 5:soldier 6+:other type.stade
- The stade of the ant. It will call evoluer() to be sur that everything it update as if the ant have grow.
-
Fourmi
Secondary constructor.- Parameters:
fere
- The anthill of this.e
- The specie of this.typeF
- The typeF of this. It can be 0: ♀, 1: ♂, 2: Minor, 3: Medium, 4:Major, 5:soldier 6+:other type.stade
- The stade of the ant. It will call evoluer() to be sur that everything it update as if the ant have grow up.ph
- The Pheromone of the ant.
-
Fourmi
public Fourmi()Null constructor.
Use only for test.
-
-
Method Details
-
getTypeF
public byte getTypeF() -
setTypeF
public void setTypeF(byte s) -
setTypeF
public void setTypeF(int x) -
getSex
-
getMode
public byte getMode() -
isAutoMode
public boolean isAutoMode() -
setMode
public void setMode(byte x) -
setMode
public void setMode(int x) -
setFourmiliere
-
setFere
-
getFourmiliere
-
getFere
-
getJoueur
-
getHardnessMax
public byte getHardnessMax() -
setHardnessMax
public void setHardnessMax(byte x) -
getX
public int getX() -
getY
public int getY() -
setFoodMoinsConsomFood
public void setFoodMoinsConsomFood() -
getIndividu
-
getTropDeFood
public boolean getTropDeFood() -
getFemelle
public boolean getFemelle()- Specified by:
getFemelle
in classCreature
-
setFemelle
public void setFemelle(boolean b) - Specified by:
setFemelle
in classCreature
-
getType
public byte getType() -
getHaveWings
public boolean getHaveWings()return true if Ant still have wings.- Specified by:
getHaveWings
in classCreature
-
getCutWings
public boolean getCutWings() -
setCutWings
public void setCutWings(boolean b) -
getUneSeuleAction
public static byte getUneSeuleAction() -
setUneSeuleAction
public static void setUneSeuleAction(int x) -
setUneSeuleAction
public static void setUneSeuleAction() -
getBActionHaveChange
public static boolean getBActionHaveChange() -
setBActionHaveChange
public static void setBActionHaveChange(boolean b) Setter that notify playing ant in case it was waiting for an action to be choose. -
getName
-
isImago
public boolean isImago() -
getReine
-
getHealthLost
public byte getHealthLost() -
getFoodConso
public int getFoodConso() -
isAI
public boolean isAI()Return true if is own by an AI.
If it have an anthill that have a player it will return getIa() value of the player. -
setAction
public void setAction(int x) Update action & update view. -
getStateHealth
public int getStateHealth()Return the state of the Fourmi concerning health.- Overrides:
getStateHealth
in classCreature
- Returns:
- an int from 0 to 3 (0=OK, 1=medium, 2=bad, 3=critical)
-
getMovingCost
public int getMovingCost()- Overrides:
getMovingCost
in classCreature
-
toString
Description copied from class:Creature
Return a description of the creature. -
afficheToi
public void afficheToi() -
estReine
public boolean estReine() -
description
-
getMaxAgeIndividu
public int getMaxAgeIndividu(int especeTempId, int stadeTemp) return the max age for an Individu depending of Espece & stade.- Parameters:
especeTempId
- Temporary Espece id.stadeTemp
- Temporary stade.
-
getMaxAgeIndividu
public int getMaxAgeIndividu()return the max age for an Individu with stade=0 (imago) & individu already define. -
getMultiplicateurDeDiff
public double getMultiplicateurDeDiff()return the difficulty multiplier.
Difficulty multiplier is in [0.2;3] -
getSeuilDeRisqueDInfection
public int getSeuilDeRisqueDInfection() -
estALaFere
public boolean estALaFere()True if the ant is at its anthill. -
descriptionTableau
-
toStringShort
Return a short string that describe this.- Overrides:
toStringShort
in classCreature
-
descriptionGString
public fr.formiko.usual.structures.listes.GString descriptionGString() -
salir
public void salir()un-clean this. It also let this died if it is under the seuilDeRisqueDInfection & that this have bad luck. -
wantFood
public boolean wantFood()return true if this whant some food. This ask for food if it is hungry at 5% or if food is < at what we need for 2 days. -
wantClean
public boolean wantClean()return true if this whant to be clean. This want to le clean if in 2 turns it will be under the seuilDeRisqueDInfection. -
iniTour
public void iniTour()initialize tour value for an ant.
If that's a non-ai player it will have TourFourmiNonIa else it will have TourReine or TourFourmi depending of getReine(). -
iniPheromone
public void iniPheromone()Initialize ph value for an ant.
It take similar pheromone to the 1 of the queen. If the queen is death it take ph from the 1a an of the anthill. If there is not more and it take a random pheromone.
-