Tata
This commit is contained in:
parent
09fb1e7aa4
commit
ecd5504100
@ -35,7 +35,7 @@ public class ComportementActionChangerCouleurCase implements ComportementAction
|
||||
CaseColore caseColore = (CaseColore) p.getCaseCourante();
|
||||
caseColore.setOccupant(null);
|
||||
|
||||
CaseColore dest = (CaseColore) cases.get(item);
|
||||
CaseColore dest = cases.get(item);
|
||||
dest.setOccupant(p);
|
||||
p.setCaseCourante(dest);
|
||||
|
||||
|
@ -9,6 +9,7 @@ import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
public class ComportementActionSeDeplacer implements ComportementAction {
|
||||
CaseAbstraite destination;
|
||||
|
||||
@Override
|
||||
public void executerAction(Personnage perso, Tuple<ArrayList<Personnage>, ArrayList<ObjetAbstrait>, ArrayList<CaseAbstraite>> t) {
|
||||
@ -24,13 +25,13 @@ public class ComportementActionSeDeplacer implements ComportementAction {
|
||||
int item = new Random().nextInt(size);
|
||||
destination = cases.get(item);
|
||||
} else {
|
||||
recupererObjets(objs, destination, perso);
|
||||
recupererObjets(objs, perso);
|
||||
}
|
||||
destination.setOccupant(perso);
|
||||
perso.setCaseCourante(destination);
|
||||
}
|
||||
|
||||
private void recupererObjets(ArrayList<ObjetAbstrait> objs, CaseAbstraite destination, Personnage perso) {
|
||||
private void recupererObjets(ArrayList<ObjetAbstrait> objs, Personnage perso) {
|
||||
int size = objs.size();
|
||||
int item = new Random().nextInt(size);
|
||||
destination = objs.get(item).getCaseCourante();
|
||||
|
@ -58,7 +58,10 @@ public class SimulationJeu {
|
||||
|
||||
// bloquer le tour jusqu'a toucher une touche du clavier.
|
||||
Scanner s = new Scanner(System.in);
|
||||
s.nextLine();
|
||||
String choix = s.nextLine();
|
||||
if (choix == "s") {
|
||||
continuer = false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user