2021-12-01 19:55:46 +00:00
|
|
|
import java.util.List;
|
2021-12-02 13:23:06 +00:00
|
|
|
import java.io.InputStreamReader;
|
|
|
|
import java.io.BufferedReader;
|
2021-12-01 19:55:46 +00:00
|
|
|
|
2021-11-30 19:49:01 +00:00
|
|
|
public class Personne {
|
|
|
|
String nom;
|
|
|
|
Condition visible;
|
|
|
|
Condition obligatoire;
|
2021-12-04 14:59:35 +00:00
|
|
|
List<Interaction> interactions;
|
2021-11-30 19:49:01 +00:00
|
|
|
|
|
|
|
public Personne(
|
|
|
|
String nom,
|
|
|
|
Condition visible,
|
|
|
|
Condition obligatoire,
|
2021-12-04 14:59:35 +00:00
|
|
|
List<Interaction> interactions) {
|
2021-11-30 19:49:01 +00:00
|
|
|
this.nom = nom;
|
|
|
|
this.visible = visible;
|
|
|
|
this.obligatoire = obligatoire;
|
2021-12-04 14:59:35 +00:00
|
|
|
this.interactions = interactions;
|
2021-11-30 19:49:01 +00:00
|
|
|
}
|
2021-12-02 13:23:06 +00:00
|
|
|
|
|
|
|
void interragir(BufferedReader reader, Lieu lieu) {
|
2021-12-04 14:59:35 +00:00
|
|
|
for (Interaction i : this.interactions) {
|
2021-12-02 13:23:06 +00:00
|
|
|
if (i.visible.evaluer()) {
|
|
|
|
i.interragir(reader, lieu);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return nom;
|
|
|
|
}
|
2021-11-30 19:49:01 +00:00
|
|
|
}
|