tp2correction
This commit is contained in:
35
Amphi.java
Normal file
35
Amphi.java
Normal file
@@ -0,0 +1,35 @@
|
||||
package lepack;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Amphi extends Salle {
|
||||
|
||||
private int hauteurSousPlafond;
|
||||
private boolean regie;
|
||||
private ArrayList<Salle> sallesVoisines;
|
||||
|
||||
public Amphi(String numSalle, int ht, boolean aUneRegie) {
|
||||
super(numSalle);
|
||||
this.hauteurSousPlafond = ht;
|
||||
this.regie = aUneRegie;
|
||||
this.sallesVoisines = new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afficherInfos() {
|
||||
System.out.println("\n-> Amphithéâtre numero : " + getNumero());
|
||||
System.out.println(" Hauteur : " + hauteurSousPlafond + "m, Régie : " + (regie ? "Oui" : "Non"));
|
||||
|
||||
if (getListeOuvertures().isEmpty()) {
|
||||
System.out.println(" Aucune ouverture.");
|
||||
} else {
|
||||
for (Ouverture ouv : getListeOuvertures()) {
|
||||
ouv.afficherInfos();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void ajouterVoisine(Salle sa) { sallesVoisines.add(sa); }
|
||||
public int getHauteurSousPlafond() { return hauteurSousPlafond; }
|
||||
public void setHauteurSousPlafond(int hauteurSousPlafond) { this.hauteurSousPlafond = hauteurSousPlafond; }
|
||||
}
|
Reference in New Issue
Block a user