blob: 567fd3ce15aa56e4f21bc18072819ed41a967e27 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
package TP1;
import java.util.*;
public enum Lieu {
Stade("Stade de foot"),
Gymnase("Gymnase"),
Piscine("La piscine");
private ArrayList<Creneau> horairedispo = new ArrayList<Creneau>();
private String nom = "";
private Lieu(String nom){
this.nom = nom;
}
public String toString() {
String tmp = this.nom+"\n";
for (Creneau c:horairedispo)
tmp += c.toString()+"\n";
return tmp;
}
public void ajoutCreneauDisponible(Creneau c) {
horairedispo.add(c);
}
public Boolean estdisponiblePour(Creneau c) {
return horairedispo.contains(c);
}
}
|