Package fr.formiko.formiko
Class Case
java.lang.Object
fr.formiko.formiko.Case
- All Implemented Interfaces:
Serializable
Square objects use to represent the map.
- Author:
- Hydrolien
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprivate Fourmiliere
private byte
private byte
private byte
private GBlade
private GCreature
private GGraine
private fr.formiko.usual.Point
private byte
1=grass, 2=moss, 3=sand -
Constructor Summary
ConstructorDescriptionCase
(int x, int y) Case
(fr.formiko.usual.Point p) Case
(fr.formiko.usual.Point p, Fourmiliere fere, GCreature gc) Case
(fr.formiko.usual.Point p, Fourmiliere fere, GCreature gc, byte foodInsecte, byte foodInsecteMax, byte nt) -
Method Summary
Modifier and TypeMethodDescriptionvoid
private void
addBlades
(int nbrBlades) Initialize GBlade back.void
addFoodInsecte
(byte x) Add x foodInsecte.void
addFoodInsecte
(int x) boolean
desc()
boolean
Standard equals function.boolean
getFere()
byte
byte
byte
getGb()
getGc()
getGg()
getGi()
int
Returns The number of element on this..fr.formiko.usual.Point
getP()
fr.formiko.usual.Point
getPoint()
Returns The GCreature sorted by friendly level with an ant..byte
getType()
int
getX()
int
getY()
private void
Initialize GBlade back.int
Give a score about herbivore interest for this square.int
length()
Returns The number of element on this..private void
removeBlades
(int nbrBlades) Initialize GBlade back.void
removeFoodInsecte
(byte x) remove x foodInsecte.void
removeFoodInsecte
(int x) void
setFere
(Fourmiliere fere) void
setFoodInsecte
(byte x) Update to x foodInsecte.void
setFoodInsecte
(int x) void
setFoodInsecteMax
(byte x) void
setFoodInsecteParTour
(byte x) void
void
setP
(fr.formiko.usual.Point p) void
setType
(byte type) Update type & GBlade depending of type.void
setType
(int x) toString()
Return a string that describe this.Return a short string that describe this.void
Update foodInsecte.
-
Field Details
-
p
private fr.formiko.usual.Point p -
type
private byte type1=grass, 2=moss, 3=sand -
fere
-
gc
-
gg
-
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
-
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
-
setFere
-
getGc
-
setGc
-
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
-
getGGraine
-
getGg
-
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
Return a string that describe this. -
toStringShort
Return a short string that describe this. -
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
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
-
equals
Standard equals function. Null & other class type proof. -
estCaseVide
public boolean estCaseVide() -
description
-
updateFoodInsecte
public void updateFoodInsecte()Update foodInsecte. It also update GBlade if needed. -
actualisationGraine
-
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.
-