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.
43 lines
659 B
Java
43 lines
659 B
Java
package modeles;
|
|
/*
|
|
* @author flavien
|
|
*/
|
|
|
|
public class Porte {
|
|
private int id =0;
|
|
private boolean ouvert;
|
|
private Salle salle1;
|
|
private Salle salle2;
|
|
|
|
public Porte() {
|
|
|
|
}
|
|
|
|
public Porte(int id,boolean ouvert, Salle salle,Salle salle2) {
|
|
super();
|
|
this.ouvert = ouvert;
|
|
this.salle1 = salle;
|
|
this.salle2 = salle2;
|
|
this.id++;
|
|
}
|
|
public boolean estOuverte() {
|
|
return ouvert;
|
|
}
|
|
|
|
public void ouverture() {
|
|
this.ouvert= true;
|
|
}
|
|
|
|
public Salle prochainSaut(Salle s) {
|
|
if (s==this.salle1) {
|
|
return salle2;
|
|
} else return salle1;
|
|
}
|
|
|
|
public int getId() {
|
|
return this.id;
|
|
}
|
|
|
|
|
|
}
|