projet-genie-logiciel-systeme/enigme.java/Personne.java
2021-12-02 14:23:06 +01:00

36 lines
835 B
Java

import java.util.List;
import java.io.InputStreamReader;
import java.io.BufferedReader;
public class Personne {
String nom;
Condition visible;
Condition obligatoire;
List<Interaction> interractions;
public Personne(
String nom,
Condition visible,
Condition obligatoire,
List<Interaction> interractions) {
this.nom = nom;
this.visible = visible;
this.obligatoire = obligatoire;
this.interractions = interractions;
}
void interragir(BufferedReader reader, Lieu lieu) {
for (Interaction i : this.interractions) {
if (i.visible.evaluer()) {
i.interragir(reader, lieu);
}
break;
}
}
@Override
public String toString() {
return nom;
}
}