petite modification de certaines classes

This commit is contained in:
Theo_Dubo 2019-05-16 10:33:21 +02:00
parent 7b3f48f0fa
commit dac5861088
3 changed files with 9 additions and 10 deletions

View File

@ -26,7 +26,6 @@ public class EtreVivant {
this.pVieMax = pVieMax;
this.pVie = pVieMax;
this.pAttaque = pAttaque;
this.salle = salle;
this.vivant = true;
}
/**

View File

@ -17,7 +17,9 @@ public class Porte {
super();
this.ouvert = ouvert;
this.salle1 = salle;
this.salle1.getListePorte().add(this.id);
this.salle2 = salle2;
this.salle2.getListePorte().add(this.id);
this.id++;
}
public boolean estOuverte() {

View File

@ -4,14 +4,10 @@ import java.util.ArrayList;
import java.util.List;
import javafx.util.Pair;
/**
* @author flavien
*
*/
public class Salle {
private Pair<Integer,Integer> coordonnees;
private boolean sortie;
private List<Porte> listePorte= new ArrayList<Porte>();
private List<Integer> listePorte= new ArrayList<Integer>();
private List<Integer> listeEnnemie= new ArrayList<Integer>(); //indice de monstre
public Salle(int x, int y, boolean out) {
@ -38,15 +34,17 @@ public class Salle {
return sortie;
}
public void cle() {
public void cle(Labyrinthe lab) {
if (listeEnnemie.isEmpty()) {
for (Porte p : listePorte) {
p.ouverture();
}
for (int i : listePorte ) lab.listePorte.get(i).ouverture();
}
}
public boolean estVide() {
return listeEnnemie.isEmpty();
}
public List<Integer> getListePorte() {
return this.listePorte;
}
}