Package fr.formiko.formiko
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 Summary
Fields inherited from class fr.formiko.usual.structures.listes.Liste
head, tail
-
Constructor Summary
ConstructorDescriptionMain constructor.GCreature
(int nbrDeCreature, Fourmiliere fere, Espece e, CCase cc) Constructor that create an empty GCreature and then fill it as a Fourmiliere. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Sort this depending of health.copier()
return the Creatures that are ally with c.private GCreature
filterAlliés
(Creature cTested, int differenceTolerated) Return the Creatures that are ally with c.delete Creature that can't eat more.delete Creature that can't be cleaner.delete Creature that didn't whant clean.delete Creature that didn't whant food.int[]
gcToTInt()
Return an array of id.getBrood()
{summary Return all the Creature at an other stade than 0.}getCreatureById
(int id) return the Creature that have this id.private Creature
getCreatureByIdE
(int id) return the Creature that have this id.Return species of this GCreature as if it was the gc of an anthill.getFourmiById
(int id) return the Fourmi that have this id.getFourmiParFere
(Fourmiliere fere) private Fourmi
getFourmiParFereE
(Fourmiliere fere) getGcStade
(int stade) {summary Return all the Creature at a specific stade.}getGcType
(int typeF) {summary Return all the Ant at a specific typeF.}getGi()
Return all Insecte from this.int
getNbrGcStade
(int x) int
int
Count worker imago.int
getReine()
{summary Return the 1a queen of the anthill} ,or null if there is no qeen.boolean
Return true if all Creature have played to there last action.boolean
Return true if all ant are in autoMode.boolean
Return true if all ant are in autoMode.void
jouer()
Play as an ant.private void
jouerE()
Play as an ant.void
preTurn()
reset action before the turn of all the ant.private void
preTurnE()
reset action before the turn of all the ant.boolean
Force all the GCreature Creature to end there turn.void
setLienFere
(Fourmiliere fere) private static GCreature
Return a list with all this class functions.int[]
toTId()
void
Update Black and cloud Case.Methods inherited from class fr.formiko.usual.structures.listes.Liste
add, add, add, addAll, addAll, addHead, addList, addSorted, addTail, clear, contains, containsAll, equals, filter, get, getFirst, getHead, getItem, getLast, getMost, getTail, indexOf, isEmpty, iterator, lastIndexOf, length, listIterator, listIterator, pop, push, push, remove, remove, removeAll, removeDuplicateItem, removeItem, retainAll, set, setHead, setTail, size, sort, subList, toArray, toArray, toGString, toString, toStringLong, updateTail
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.List
hashCode, replaceAll, spliterator
-
Field Details
-
loopSafety
private byte loopSafety
-
-
Constructor Details
-
GCreature
public GCreature()Main constructor. -
GCreature
Constructor that create an empty GCreature and then fill it as a Fourmiliere.
-
-
Method Details
-
getReine
{summary Return the 1a queen of the anthill} ,or null if there is no qeen. -
getGcStade
{summary Return all the Creature at a specific stade.}- Parameters:
stade
- the specific stade to fined
-
getGcType
{summary Return all the Ant at a specific typeF.}- Parameters:
typeF
- the specific typeF to fined
-
getBrood
{summary Return all the Creature at an other stade than 0.} -
getBroodSaleE
- Throws:
fr.formiko.usual.exceptions.EmptyListException
-
getBroodSale
-
getBroodsSale
-
getCreatureByIdE
return the Creature that have this id.- Parameters:
id
- the id of the creature- Throws:
fr.formiko.usual.exceptions.EmptyListException
-
getCreatureById
return the Creature that have this id.- Parameters:
id
- the id of the creature
-
getFourmiById
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
-
toGc
Return a list with all this class functions. -
filterAlliés
Return the Creatures that are ally with c.- Parameters:
cTested
- the tested creaturedifferenceTolerated
- the Pheromone difference that is tolerated
-
filterAlliés
return the Creatures that are ally with c.- Parameters:
c
- the tested creature.
-
filterFaimMax
delete Creature that can't eat more. -
filterHealthMax
delete Creature that can't be cleaner. -
filterWantFood
delete Creature that didn't whant food. -
filterWantClean
delete Creature that didn't whant clean. -
setLienFere
-
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
Return species of this GCreature as if it was the gc of an anthill. -
gcToTInt
public int[] gcToTInt()Return an array of id. -
copier
-
getGi
Return all Insecte from this. -
jouerE
private void jouerE() throws fr.formiko.usual.exceptions.EmptyListExceptionPlay 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.EmptyListExceptionreset 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
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.
-