petite modification de certaines classes
This commit is contained in:
parent
7b3f48f0fa
commit
dac5861088
@ -26,7 +26,6 @@ public class EtreVivant {
|
|||||||
this.pVieMax = pVieMax;
|
this.pVieMax = pVieMax;
|
||||||
this.pVie = pVieMax;
|
this.pVie = pVieMax;
|
||||||
this.pAttaque = pAttaque;
|
this.pAttaque = pAttaque;
|
||||||
this.salle = salle;
|
|
||||||
this.vivant = true;
|
this.vivant = true;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -17,7 +17,9 @@ public class Porte {
|
|||||||
super();
|
super();
|
||||||
this.ouvert = ouvert;
|
this.ouvert = ouvert;
|
||||||
this.salle1 = salle;
|
this.salle1 = salle;
|
||||||
|
this.salle1.getListePorte().add(this.id);
|
||||||
this.salle2 = salle2;
|
this.salle2 = salle2;
|
||||||
|
this.salle2.getListePorte().add(this.id);
|
||||||
this.id++;
|
this.id++;
|
||||||
}
|
}
|
||||||
public boolean estOuverte() {
|
public boolean estOuverte() {
|
||||||
|
|||||||
@ -4,14 +4,10 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javafx.util.Pair;
|
import javafx.util.Pair;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author flavien
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class Salle {
|
public class Salle {
|
||||||
private Pair<Integer,Integer> coordonnees;
|
private Pair<Integer,Integer> coordonnees;
|
||||||
private boolean sortie;
|
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
|
private List<Integer> listeEnnemie= new ArrayList<Integer>(); //indice de monstre
|
||||||
|
|
||||||
public Salle(int x, int y, boolean out) {
|
public Salle(int x, int y, boolean out) {
|
||||||
@ -38,15 +34,17 @@ public class Salle {
|
|||||||
return sortie;
|
return sortie;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void cle() {
|
public void cle(Labyrinthe lab) {
|
||||||
if (listeEnnemie.isEmpty()) {
|
if (listeEnnemie.isEmpty()) {
|
||||||
for (Porte p : listePorte) {
|
for (int i : listePorte ) lab.listePorte.get(i).ouverture();
|
||||||
p.ouverture();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean estVide() {
|
public boolean estVide() {
|
||||||
return listeEnnemie.isEmpty();
|
return listeEnnemie.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<Integer> getListePorte() {
|
||||||
|
return this.listePorte;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user