diff --git a/src/Cases/CaseAbstraite.java b/src/Cases/CaseAbstraite.java index cb3b7cd..65df6a4 100644 --- a/src/Cases/CaseAbstraite.java +++ b/src/Cases/CaseAbstraite.java @@ -25,24 +25,24 @@ public abstract class CaseAbstraite { } public void generateVoisins(CaseAbstraite[][] plateau) { - for (int i = coord.getHor() - 1; i < coord.getHor() + 1; i++) { - for (int j = coord.getVert() - 1; j < coord.getVert() + 1; j++) { - if (i > 0 && i < plateau.length && j > 0 && j < plateau[0].length) { - if (i == coord.getHor() && j < coord.getVert()) { + for (int i = coord.getLigne() - 1; i <= coord.getLigne() + 1; i++) { + for (int j = coord.getCol() - 1; j <= coord.getCol() + 1; j++) { + if (i >= 0 && i < plateau.length && j >= 0 && j < plateau[0].length) { + if (i < coord.getLigne() && j == coord.getCol()) { voisins.put(PointsCardinaux.N, plateau[i][j]); - } else if (i > coord.getHor() && j < coord.getVert()) { + } else if (i < coord.getLigne() && j > coord.getCol()) { voisins.put(PointsCardinaux.NE, plateau[i][j]); - } else if (i > coord.getHor() && j == coord.getVert()) { + } else if (i == coord.getLigne() && j > coord.getCol()) { voisins.put(PointsCardinaux.E, plateau[i][j]); - } else if (i > coord.getHor() && j > coord.getVert()) { - voisins.put(PointsCardinaux.NE, plateau[i][j]); - } else if (i == coord.getHor() && j > coord.getVert()) { + } else if (i > coord.getLigne() && j > coord.getCol()) { + voisins.put(PointsCardinaux.SE, plateau[i][j]); + } else if (i > coord.getLigne() && j == coord.getCol()) { voisins.put(PointsCardinaux.S, plateau[i][j]); - } else if (i < coord.getHor() && j > coord.getVert()) { + } else if (i > coord.getLigne() && j < coord.getCol()) { voisins.put(PointsCardinaux.SW, plateau[i][j]); - } else if (i < coord.getHor() && j == coord.getVert()) { + } else if (i == coord.getLigne() && j < coord.getCol()) { voisins.put(PointsCardinaux.W, plateau[i][j]); - } else if (i < coord.getHor() && j < coord.getVert()) { + } else if (i < coord.getLigne() && j < coord.getCol()) { voisins.put(PointsCardinaux.NW, plateau[i][j]); } } diff --git a/src/Cases/Coordonnees.java b/src/Cases/Coordonnees.java index 9c4a985..83f9482 100644 --- a/src/Cases/Coordonnees.java +++ b/src/Cases/Coordonnees.java @@ -1,27 +1,27 @@ package Cases; public class Coordonnees { - private int vert; - private int hor; + private int col; + private int ligne; public Coordonnees(int vert, int hor) { - this.vert = vert; - this.hor = hor; + this.col = vert; + this.ligne = hor; } - public int getVert() { - return vert; + public int getLigne() { + return ligne; } - public void setVert(int vert) { - this.vert = vert; + public void setLigne(int ligne) { + this.ligne = ligne; } - public int getHor() { - return hor; + public int getCol() { + return col; } - public void setHor(int hor) { - this.hor = hor; + public void setCol(int col) { + this.col = col; } } diff --git a/src/Etats/EtatPersonnageAbstrait.java b/src/Etats/EtatPersonnageAbstrait.java index 1b8e156..b8a1d27 100644 --- a/src/Etats/EtatPersonnageAbstrait.java +++ b/src/Etats/EtatPersonnageAbstrait.java @@ -9,10 +9,6 @@ public abstract class EtatPersonnageAbstrait { protected EtatPersonnageAbstrait(Personnage perso){ this.joueur = perso; } - - public abstract void AnalyseJoueur(); - public abstract void ExecutionJoueur(); - public abstract void ConflitJoueur(); - public abstract void mediationConflits(); + protected abstract void execute(); } diff --git a/src/Etats/EtatPersonnageCombattant.java b/src/Etats/EtatPersonnageCombattant.java deleted file mode 100644 index 702972f..0000000 --- a/src/Etats/EtatPersonnageCombattant.java +++ /dev/null @@ -1,37 +0,0 @@ -package Etats; - -import Person.Personnage; - -public class EtatPersonnageCombattant extends EtatPersonnageAbstrait { - - //Etat d'un personnage avec un marteau, cible les joueurs et ignore le reste. - - protected EtatPersonnageCombattant(Personnage perso) { - super(perso); - // TODO Auto-generated constructor stub - } - - @Override - public void AnalyseJoueur() { - // TODO Auto-generated method stub - - } - - @Override - public void ExecutionJoueur() { - // TODO Auto-generated method stub - - } - - @Override - public void ConflitJoueur() { - // TODO Auto-generated method stub - - } - - @Override - public void mediationConflits() { - - } - -} diff --git a/src/Etats/EtatPersonnageKO.java b/src/Etats/EtatPersonnageKO.java index 95fb399..eb1cb6a 100644 --- a/src/Etats/EtatPersonnageKO.java +++ b/src/Etats/EtatPersonnageKO.java @@ -8,37 +8,12 @@ public class EtatPersonnageKO extends EtatPersonnageAbstrait { public EtatPersonnageKO(Personnage perso) { super(perso); - // TODO Auto-generated constructor stub - - this.nbTourKO = 3; - } - - @Override - public void AnalyseJoueur() { - // TODO Auto-generated method stub - - } - - @Override - public void ExecutionJoueur() { - // TODO Auto-generated method stub - - nbTourKO--; - if (nbTourKO==0){ - this.joueur.ChangeEtat(EEtat.EtatOK); - } - - } - - @Override - public void ConflitJoueur() { - // TODO Auto-generated method stub - } @Override - public void mediationConflits() { - + protected void execute() { + if (this.joueur.getPointsDeVie() > 0) { + this.joueur.ChangeEtat(EEtat.EtatOK); + } } - } diff --git a/src/Etats/EtatPersonnageOK.java b/src/Etats/EtatPersonnageOK.java index 7c60fe1..7222220 100644 --- a/src/Etats/EtatPersonnageOK.java +++ b/src/Etats/EtatPersonnageOK.java @@ -1,72 +1,21 @@ package Etats; -import Comportements.*; import Person.Personnage; public class EtatPersonnageOK extends EtatPersonnageAbstrait { - - private ComportementAction Action; - public EtatPersonnageOK(Personnage perso) { - super(perso); - // TODO Auto-generated constructor stub + private int nbTourKO; - this.ChangerAction(EAction.SeDeplacer); + public EtatPersonnageOK(Personnage perso) { + super(perso); + this.nbTourKO = 3; } - @Override - public void AnalyseJoueur() { - // TODO Auto-generated method stub - - } - - @Override - public void ExecutionJoueur() { - // TODO Auto-generated method stub - Action.executerAction(this.joueur); - } - - @Override - public void ConflitJoueur() { - // TODO Auto-generated method stub - - } - @Override - public void mediationConflits() { - + protected void execute() { + if (this.joueur.getPointsDeVie() == 0) { + this.joueur.ChangeEtat(EEtat.EtatKO); + } } - public void ChangerAction(EAction nouvelAction) { - - switch(nouvelAction) - { - case ChangerCouleurCase: - Action = new ComportementActionChangerCouleurCase(); - break; - case RamasserNeige: - Action = new ComportementActionRamasserNeige(); - break; - case SeDeplacer: - Action = new ComportementActionSeDeplacer(); - break; - case TirerBalon: - Action = new ComportementActionTirerBalon(); - break; - case TirerBouleDeNeige: - Action = new ComportementActionTirerBouleDeNeige(); - break; - //case Null: - //Action = null; - //break; - default: - break; - - } - - this.joueur.setAction(nouvelAction); - } - - - } diff --git a/src/Fabriques/Personnages/FabriquePersonnagesBattleZone.java b/src/Fabriques/Personnages/FabriquePersonnagesBattleZone.java index 0f256b3..af22e32 100644 --- a/src/Fabriques/Personnages/FabriquePersonnagesBattleZone.java +++ b/src/Fabriques/Personnages/FabriquePersonnagesBattleZone.java @@ -14,14 +14,14 @@ public class FabriquePersonnagesBattleZone extends FabriquePersonnagesAbstraite public ArrayList CreerPersonages(Organisation o) { ArrayList list = new ArrayList(); - PersonnageBattleZone p1 = new PersonnageBattleZone("Bob", 100.0, 1.0, 1.0, parDefaut); + PersonnageBattleZone p1 = new PersonnageBattleZone("Bob", 100.0, 1.0, 1.0, 2, parDefaut); list.add(p1); - PersonnageBattleZone p2 = new PersonnageBattleZone("Jo", 100.0, 1.0, 1.0, parDefaut); - list.add(p2); - PersonnageBattleZone p3 = new PersonnageBattleZone("Max", 100.0, 1.0, 1.0, parDefaut); - list.add(p3); - PersonnageBattleZone p4 = new PersonnageBattleZone("Zac", 100.0, 1.0, 1.0, parDefaut); - list.add(p4); + //PersonnageBattleZone p2 = new PersonnageBattleZone("Jo", 100.0, 1.0, 1.0, 2, parDefaut); + //list.add(p2); + //PersonnageBattleZone p3 = new PersonnageBattleZone("Max", 100.0, 1.0, 1.0, 2, parDefaut); + //list.add(p3); + //PersonnageBattleZone p4 = new PersonnageBattleZone("Zac", 100.0, 1.0, 1.0, 2, parDefaut); + //list.add(p4); return list; } } diff --git a/src/Person/Personnage.java b/src/Person/Personnage.java index cfb781a..b797cf5 100644 --- a/src/Person/Personnage.java +++ b/src/Person/Personnage.java @@ -2,8 +2,7 @@ package Person; import Cases.CaseAbstraite; import Cases.PointsCardinaux; -import Comportements.ComportementAction; -import Comportements.EAction; +import Comportements.*; import Composition.PersonnagesAbstraits; import Etats.EEtat; import Etats.EtatPersonnageAbstrait; @@ -11,7 +10,9 @@ import Etats.EtatPersonnageKO; import Etats.EtatPersonnageOK; import Objets.ObjetAbstrait; +import java.util.ArrayList; import java.util.HashMap; +import java.util.HashSet; public class Personnage extends PersonnagesAbstraits { @@ -22,33 +23,38 @@ public class Personnage extends PersonnagesAbstraits { protected double pointsDeVie; protected double force; protected double vitesse; - protected double porter; - protected EAction action; - private EtatPersonnageAbstrait etatCourant; + protected double portee; + protected EAction action; + protected ComportementAction Action; + private EtatPersonnageAbstrait etatCourant; private HashMap voisins; - protected Personnage(String name, ComportementAction c) { - this.nom = name; + + protected Personnage(String name, ComportementAction c) { + this.nom = name; this.pointsDeVie = 100; this.force = 10; this.vitesse = 1; - this.porter = 2; + this.portee = 2; this.caseCourante = null; this.etatCourant = new EtatPersonnageOK(this); - this.action = EAction.Null; - } + this.ChangerAction(EAction.SeDeplacer); - protected Personnage(String name, double lifePoint, double strength, double speed, ComportementAction a) { - this.nom = name; + } + + protected Personnage(String name, double lifePoint, double strength, double speed, int portee, ComportementAction a) { + this.nom = name; this.pointsDeVie=lifePoint; this.force=strength; this.vitesse=speed; - + this.portee = portee; + this.caseCourante=null; this.etatCourant= new EtatPersonnageOK(this); - this.action = EAction.Null; - } + this.ChangerAction(EAction.SeDeplacer); + + } public void ChangeEtat(EEtat NouvelEtat) @@ -126,14 +132,14 @@ public class Personnage extends PersonnagesAbstraits { this.voisins = this.caseCourante.getVoisins(); } - - public double getPorter() { - return porter; - } - public void setPorter(double porter) { - this.porter = porter; - } + public double getPortee() { + return portee; + } + + public void setPortee(double portee) { + this.portee = portee; + } public EAction getAction() { return action; @@ -144,188 +150,97 @@ public class Personnage extends PersonnagesAbstraits { } public void AnalyseSituation() { - etatCourant.AnalyseJoueur(); + ArrayList objets = rechercheObjetProche(); + ArrayList personnages = rechercheJoueur(); } public void Execution() { - etatCourant.ExecutionJoueur(); + Action.executerAction(this); } public void ResoudreLesConflits(){ - etatCourant.ConflitJoueur(); + + } - public ObjetAbstrait rechercheObjetProche() { + public HashMap voisinsPortee(CaseAbstraite c, int rayon) { + HashMap voisinsActuels = new HashMap(); + HashMap v = c.getVoisins(); + if ((rayon + 1) == this.getPortee()) { + // voisinsActuels.putAll(v); + return c.getVoisins(); + } else { + int r = rayon + 1; + for (PointsCardinaux mapKey : v.keySet()) { + voisinsActuels.putAll(voisinsPortee(v.get(mapKey), r)); + } + return voisinsActuels; + } + } - ObjetAbstrait objetDeLaCase = null; + public ArrayList rechercheObjetProche() { - for (PointsCardinaux mapKey : voisins.keySet()) { - if (voisins.get(mapKey).getObjetOccupant() != null) { - objetDeLaCase = voisins.get(mapKey).getObjetOccupant(); + ArrayList objetsVoisins = new ArrayList(); + + HashSet voisinsDesVoisins = getCaseAbstraitesForPortee(); + + for (CaseAbstraite c : voisinsDesVoisins) { + if (c.getObjetOccupant() != null) { + objetsVoisins.add(c.getObjetOccupant()); } } - if (objetDeLaCase != null) { - for (PointsCardinaux mapKey : voisins.keySet()) { - switch (mapKey) { - case N: - if (voisins.get(mapKey).getVoisins().get(PointsCardinaux.N) != null) { - objetDeLaCase = voisins.get(mapKey).getVoisins().get(PointsCardinaux.N).getObjetOccupant(); - } - break; - case NE: - if (voisins.get(mapKey).getVoisins().get(PointsCardinaux.N) != null) { - objetDeLaCase = voisins.get(mapKey).getVoisins().get(PointsCardinaux.N).getObjetOccupant(); - } - if (voisins.get(mapKey).getVoisins().get(PointsCardinaux.NE) != null) { - objetDeLaCase = voisins.get(mapKey).getVoisins().get(PointsCardinaux.NE).getObjetOccupant(); - } - if (voisins.get(mapKey).getVoisins().get(PointsCardinaux.E) != null) { - objetDeLaCase = voisins.get(mapKey).getVoisins().get(PointsCardinaux.E).getObjetOccupant(); - } - break; - case E: - if (voisins.get(mapKey).getVoisins().get(PointsCardinaux.E) != null) { - objetDeLaCase = voisins.get(mapKey).getVoisins().get(PointsCardinaux.E).getObjetOccupant(); - } - break; - case SE: - if (voisins.get(mapKey).getVoisins().get(PointsCardinaux.E) != null) { - objetDeLaCase = voisins.get(mapKey).getVoisins().get(PointsCardinaux.E).getObjetOccupant(); - } - if (voisins.get(mapKey).getVoisins().get(PointsCardinaux.SE) != null) { - objetDeLaCase = voisins.get(mapKey).getVoisins().get(PointsCardinaux.SE).getObjetOccupant(); - } - if (voisins.get(mapKey).getVoisins().get(PointsCardinaux.S) != null) { - objetDeLaCase = voisins.get(mapKey).getVoisins().get(PointsCardinaux.S).getObjetOccupant(); - } - break; - case S: - if (voisins.get(mapKey).getVoisins().get(PointsCardinaux.S) != null) { - objetDeLaCase = voisins.get(mapKey).getVoisins().get(PointsCardinaux.S).getObjetOccupant(); - } - break; - case SW: - if (voisins.get(mapKey).getVoisins().get(PointsCardinaux.S) != null) { - objetDeLaCase = voisins.get(mapKey).getVoisins().get(PointsCardinaux.S).getObjetOccupant(); - } - if (voisins.get(mapKey).getVoisins().get(PointsCardinaux.SW) != null) { - objetDeLaCase = voisins.get(mapKey).getVoisins().get(PointsCardinaux.SW).getObjetOccupant(); - } - if (voisins.get(mapKey).getVoisins().get(PointsCardinaux.W) != null) { - objetDeLaCase = voisins.get(mapKey).getVoisins().get(PointsCardinaux.W).getObjetOccupant(); - } - break; - case W: - if (voisins.get(mapKey).getVoisins().get(PointsCardinaux.W) != null) { - objetDeLaCase = voisins.get(mapKey).getVoisins().get(PointsCardinaux.W).getObjetOccupant(); - } - break; - case NW: - if (voisins.get(mapKey).getVoisins().get(PointsCardinaux.W) != null) { - objetDeLaCase = voisins.get(mapKey).getVoisins().get(PointsCardinaux.W).getObjetOccupant(); - } - if (voisins.get(mapKey).getVoisins().get(PointsCardinaux.NW) != null) { - objetDeLaCase = voisins.get(mapKey).getVoisins().get(PointsCardinaux.NW).getObjetOccupant(); - } - if (voisins.get(mapKey).getVoisins().get(PointsCardinaux.N) != null) { - objetDeLaCase = voisins.get(mapKey).getVoisins().get(PointsCardinaux.N).getObjetOccupant(); - } - break; - default: - break; + return objetsVoisins; + } - } - } - } - return objetDeLaCase; + protected HashSet getCaseAbstraitesForPortee() { + HashSet voisinsDesVoisins = new HashSet(); + voisinsDesVoisins.addAll(voisinsPortee(this.caseCourante, 0).values()); + return voisinsDesVoisins; } - public Personnage rechercheJoueur() { - Personnage personne = null; + public ArrayList rechercheJoueur() { + ArrayList personnes = new ArrayList(); - for (PointsCardinaux mapKey : voisins.keySet()) { - if (voisins.get(mapKey).getOccupant() != null) { - personne = voisins.get(mapKey).getOccupant(); + HashSet voisinsDesVoisins = getCaseAbstraitesForPortee(); + + for (CaseAbstraite c : voisinsDesVoisins) { + if (c.getOccupant() != null) { + personnes.add(c.getOccupant()); } } - if (personne != null) { - for (PointsCardinaux mapKey : voisins.keySet()) { - switch (mapKey) { - case N: - if (voisins.get(mapKey).getVoisins().get(PointsCardinaux.N) != null) { - personne = voisins.get(mapKey).getVoisins().get(PointsCardinaux.N).getOccupant(); - } - break; - case NE: - if (voisins.get(mapKey).getVoisins().get(PointsCardinaux.N) != null) { - personne = voisins.get(mapKey).getVoisins().get(PointsCardinaux.N).getOccupant(); - } - if (voisins.get(mapKey).getVoisins().get(PointsCardinaux.NE) != null) { - personne = voisins.get(mapKey).getVoisins().get(PointsCardinaux.NE).getOccupant(); - } - if (voisins.get(mapKey).getVoisins().get(PointsCardinaux.E) != null) { - personne = voisins.get(mapKey).getVoisins().get(PointsCardinaux.E).getOccupant(); - } - break; - case E: - if (voisins.get(mapKey).getVoisins().get(PointsCardinaux.E) != null) { - personne = voisins.get(mapKey).getVoisins().get(PointsCardinaux.E).getOccupant(); - } - break; - case SE: - if (voisins.get(mapKey).getVoisins().get(PointsCardinaux.E) != null) { - personne = voisins.get(mapKey).getVoisins().get(PointsCardinaux.E).getOccupant(); - } - if (voisins.get(mapKey).getVoisins().get(PointsCardinaux.SE) != null) { - personne = voisins.get(mapKey).getVoisins().get(PointsCardinaux.SE).getOccupant(); - } - if (voisins.get(mapKey).getVoisins().get(PointsCardinaux.S) != null) { - personne = voisins.get(mapKey).getVoisins().get(PointsCardinaux.S).getOccupant(); - } - break; - case S: - if (voisins.get(mapKey).getVoisins().get(PointsCardinaux.S) != null) { - personne = voisins.get(mapKey).getVoisins().get(PointsCardinaux.S).getOccupant(); - } - break; - case SW: - if (voisins.get(mapKey).getVoisins().get(PointsCardinaux.S) != null) { - personne = voisins.get(mapKey).getVoisins().get(PointsCardinaux.S).getOccupant(); - } - if (voisins.get(mapKey).getVoisins().get(PointsCardinaux.SW) != null) { - personne = voisins.get(mapKey).getVoisins().get(PointsCardinaux.SW).getOccupant(); - } - if (voisins.get(mapKey).getVoisins().get(PointsCardinaux.W) != null) { - personne = voisins.get(mapKey).getVoisins().get(PointsCardinaux.W).getOccupant(); - } - break; - case W: - if (voisins.get(mapKey).getVoisins().get(PointsCardinaux.W) != null) { - personne = voisins.get(mapKey).getVoisins().get(PointsCardinaux.W).getOccupant(); - } - break; - case NW: - if (voisins.get(mapKey).getVoisins().get(PointsCardinaux.W) != null) { - personne = voisins.get(mapKey).getVoisins().get(PointsCardinaux.W).getOccupant(); - } - if (voisins.get(mapKey).getVoisins().get(PointsCardinaux.NW) != null) { - personne = voisins.get(mapKey).getVoisins().get(PointsCardinaux.NW).getOccupant(); - } - if (voisins.get(mapKey).getVoisins().get(PointsCardinaux.N) != null) { - personne = voisins.get(mapKey).getVoisins().get(PointsCardinaux.N).getOccupant(); - } - break; - default: - break; - } - } - } - return personne; + return personnes; } public void mediationConflits() { - etatCourant.mediationConflits(); + + + } + + public void ChangerAction(EAction nouvelAction) { + + switch (nouvelAction) { + case ChangerCouleurCase: + Action = new ComportementActionChangerCouleurCase(); + break; + case RamasserNeige: + Action = new ComportementActionRamasserNeige(); + break; + case SeDeplacer: + Action = new ComportementActionSeDeplacer(); + break; + case TirerBalon: + Action = new ComportementActionTirerBalon(); + break; + case TirerBouleDeNeige: + Action = new ComportementActionTirerBouleDeNeige(); + break; + default: + break; + + } + + this.setAction(nouvelAction); } } diff --git a/src/Person/PersonnageBattleGoal.java b/src/Person/PersonnageBattleGoal.java index f225b57..628c482 100644 --- a/src/Person/PersonnageBattleGoal.java +++ b/src/Person/PersonnageBattleGoal.java @@ -4,9 +4,9 @@ import Comportements.ComportementAction; public class PersonnageBattleGoal extends Personnage { - protected PersonnageBattleGoal(String name, double lifePoint, double strength, double speed, ComportementAction parDefaut) { - super(name, lifePoint, strength, speed, parDefaut); - // TODO Auto-generated constructor stub + protected PersonnageBattleGoal(String name, double lifePoint, double strength, double speed, int portee, ComportementAction parDefaut) { + super(name, lifePoint, strength, speed, portee, parDefaut); + // TODO Auto-generated constructor stub } } diff --git a/src/Person/PersonnageBattleSnow.java b/src/Person/PersonnageBattleSnow.java index c0c2f7d..ebb6808 100644 --- a/src/Person/PersonnageBattleSnow.java +++ b/src/Person/PersonnageBattleSnow.java @@ -4,9 +4,9 @@ import Comportements.ComportementAction; public class PersonnageBattleSnow extends Personnage{ - protected PersonnageBattleSnow(String name, double lifePoint, double strength, double speed, ComportementAction parDefaut) { - super(name, lifePoint, strength, speed, parDefaut); - // TODO Auto-generated constructor stub + protected PersonnageBattleSnow(String name, double lifePoint, double strength, double speed, int portee, ComportementAction parDefaut) { + super(name, lifePoint, strength, speed, portee, parDefaut); + // TODO Auto-generated constructor stub } } diff --git a/src/Person/PersonnageBattleZone.java b/src/Person/PersonnageBattleZone.java index 10917ac..cfb7fb3 100644 --- a/src/Person/PersonnageBattleZone.java +++ b/src/Person/PersonnageBattleZone.java @@ -8,8 +8,8 @@ import java.util.Random; public class PersonnageBattleZone extends Personnage { Color couleur; - public PersonnageBattleZone(String name, double lifePoint, double strength, double speed, ComportementAction parDefaut) { - super(name, lifePoint, strength, speed, parDefaut); + public PersonnageBattleZone(String name, double lifePoint, double strength, double speed, int portee, ComportementAction parDefaut) { + super(name, lifePoint, strength, speed, portee, parDefaut); // TODO Auto-generated constructor stub diff --git a/src/SimulationJeu.java b/src/SimulationJeu.java index 0a54f02..97c27f0 100644 --- a/src/SimulationJeu.java +++ b/src/SimulationJeu.java @@ -48,14 +48,13 @@ public class SimulationJeu { boolean continuer = true; while (continuer) { - + afficheTous(); for (Personnage p : personnages) { p.AnalyseSituation(); p.Execution(); mediationDesConflits(); // utiliser le pattern avec l'historique pour les actions. On pourra faire un retour arrière si conflit + réexecturer recupererInformations(); } - afficheTous(); // bloquer le tour jusqu'a toucher une touche du clavier. Scanner s = new Scanner(System.in);