Package fr.formiko.formiko.interfaces
Class DeplacementFourmi
java.lang.Object
fr.formiko.formiko.interfaces.DeplacementFourmi
- All Implemented Interfaces:
Deplacement
,Serializable
Ant implementation.
Allow an ant to moove
Allow an ant to moove
- Author:
- Hydrolien
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
plusieurMouvement
(Creature c, CCase cc) make as much moove as we can/need to a defined Case.private void
remove some action to the moving Creaturevoid
unMouvement
(Creature c, boolean bIa) make a move.void
unMouvement
(Creature c, int direction) make a moove in a defined direction.void
unMouvement
(Creature c, Case p) make a move to a defined Case.void
unMouvement
(Creature c, CCase cc) make a move to a defined Case.private void
make a random moove.private void
unMouvementVolontaire
(int direction) make a willing moove.private boolean
unPas
(int d) Move to a next Case.private boolean
Move to a next Case.
-
Field Details
-
c
-
-
Constructor Details
-
DeplacementFourmi
public DeplacementFourmi()
-
-
Method Details
-
unMouvement
make a move.- Specified by:
unMouvement
in interfaceDeplacement
- Parameters:
c
- the moving Creature.bIa
- Is c moved by an AI or a player.
-
unMouvement
make a move to a defined Case.
c will move 1 Case closer to p but maybe p is more than 1 Case longer to c.getCCase()
c will move by the unMouvement(c,direction) methode.- Specified by:
unMouvement
in interfaceDeplacement
- Parameters:
c
- the moving Creature.p
- the Case were c want to go.
-
unMouvement
make a move to a defined Case.
c will move 1 Case closer to p but maybe p is more than 1 Case longer to c.getCCase()
c will move by the unMouvement(c,direction) methode.- Specified by:
unMouvement
in interfaceDeplacement
- Parameters:
c
- the moving Creature.cc
- the CCase were c want to go.
-
unMouvement
make a moove in a defined direction.
c will move 1 Case closer to p but maybe p is more than 1 Case longer to c.getCCase()- Specified by:
unMouvement
in interfaceDeplacement
- Parameters:
c
- the moving Creature.direction
- the direction to move. (It's a number place as on the keyboard 1= North West, 2 = North, etc)
-
plusieurMouvement
make as much moove as we can/need to a defined Case.
c will stop moving when it will have reach cc or when it actions will be < 0 c will move by the unMouvement(c,cc) methode.- Specified by:
plusieurMouvement
in interfaceDeplacement
- Parameters:
c
- the moving Creature.cc
- the CCase were c want to go.
-
unMouvementAlléa
private void unMouvementAlléa()make a random moove. -
unMouvementVolontaire
private void unMouvementVolontaire(int direction) make a willing moove.- Parameters:
direction
- the direction to move. (It's a number place as on the keyboard 1= North West, 2 = North, etc)
-
setActionMoinsDĂ©placement
private void setActionMoinsDĂ©placement()remove some action to the moving Creature
It will remove 10 action to a non-ant Creature or the individu cost to an ant. -
unPas
private boolean unPas(int d) Move to a next Case. -
unPas
Move to a next Case.
All moving thing use this methode to move.
-