2021-12-09 17:54:08 +00:00
|
|
|
import java.util.List;
|
|
|
|
import java.io.BufferedReader;
|
|
|
|
|
|
|
|
public class Personne {
|
|
|
|
String nom;
|
|
|
|
Condition visible;
|
|
|
|
Condition obligatoire;
|
|
|
|
List<Interaction> interactions;
|
|
|
|
|
|
|
|
public Personne(
|
|
|
|
String nom,
|
|
|
|
Condition visible,
|
|
|
|
Condition obligatoire,
|
|
|
|
List<Interaction> interactions) {
|
|
|
|
this.nom = nom;
|
|
|
|
this.visible = visible;
|
|
|
|
this.obligatoire = obligatoire;
|
|
|
|
this.interactions = interactions;
|
|
|
|
}
|
|
|
|
|
2022-01-18 22:29:53 +00:00
|
|
|
void interragir(BufferedReader reader) {
|
|
|
|
Jeu.clearScreen();
|
|
|
|
System.out.println(this);
|
|
|
|
|
2021-12-09 17:54:08 +00:00
|
|
|
for (Interaction i : this.interactions) {
|
|
|
|
if (i.visible.evaluer()) {
|
2022-01-18 22:29:53 +00:00
|
|
|
i.interragir(reader);
|
2021-12-09 17:54:08 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return nom;
|
|
|
|
}
|
|
|
|
}
|