diff --git a/JAVA/PROJET-PMT_STRI1A/src/modeles/EtreVivant.java b/JAVA/PROJET-PMT_STRI1A/src/modeles/EtreVivant.java index c736260..f2acbc0 100644 --- a/JAVA/PROJET-PMT_STRI1A/src/modeles/EtreVivant.java +++ b/JAVA/PROJET-PMT_STRI1A/src/modeles/EtreVivant.java @@ -26,7 +26,6 @@ public class EtreVivant { this.pVieMax = pVieMax; this.pVie = pVieMax; this.pAttaque = pAttaque; - this.salle = salle; this.vivant = true; } /** diff --git a/JAVA/PROJET-PMT_STRI1A/src/modeles/Porte.java b/JAVA/PROJET-PMT_STRI1A/src/modeles/Porte.java index c323aaa..200b3db 100644 --- a/JAVA/PROJET-PMT_STRI1A/src/modeles/Porte.java +++ b/JAVA/PROJET-PMT_STRI1A/src/modeles/Porte.java @@ -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() { diff --git a/JAVA/PROJET-PMT_STRI1A/src/modeles/Salle.java b/JAVA/PROJET-PMT_STRI1A/src/modeles/Salle.java index ef6eab9..66c6047 100644 --- a/JAVA/PROJET-PMT_STRI1A/src/modeles/Salle.java +++ b/JAVA/PROJET-PMT_STRI1A/src/modeles/Salle.java @@ -4,14 +4,10 @@ import java.util.ArrayList; import java.util.List; import javafx.util.Pair; -/** - * @author flavien - * - */ public class Salle { private Pair coordonnees; private boolean sortie; - private List listePorte= new ArrayList(); + private List listePorte= new ArrayList(); private List listeEnnemie= new ArrayList(); //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 getListePorte() { + return this.listePorte; + } }