You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.3 KiB
Java

package modeles;
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> listeEnnemie= new ArrayList<Integer>(); //indice de monstre
public Salle(int x, int y, boolean out) {
this.coordonnees=new Pair<Integer,Integer>(x,y);
this.sortie=out;
}
public Salle(int positionX, int positionY, boolean sortie, List<Integer> listeEnnemie) {
this.coordonnees=new Pair<Integer,Integer>(positionX,positionY);
this.sortie = sortie;
this.listeEnnemie = listeEnnemie;
}
public Salle(int positionX, int positionY, boolean sortie, List<Integer> listeEnnemie, Porte sal) {
this.coordonnees=new Pair<Integer,Integer>(positionX,positionY);
this.sortie = sortie;
this.listeEnnemie = listeEnnemie;
this.listePorte.add(sal);
}
public String getType(){
return "salle";
}
public Pair<Integer,Integer> getCoordonnes() {
return this.coordonnees;
}
public boolean estSortie() {
return sortie;
}
public void cle() {
if (listeEnnemie.isEmpty()) {
for (Porte p : listePorte) {
p.ouverture();
}
}
}
public boolean estVide() {
return listeEnnemie.isEmpty();
}
}