projet-genie-logiciel-systeme/enigme.java/Interaction.java
2021-12-01 21:19:08 +01:00

36 lines
901 B
Java

import java.util.List;
public class Interaction {
Condition visible;
List<Connaissance> connaissances;
List<Objet> objetsRecus;
List<Objet> objetsConso;
List<Action> actions;
public Interaction(
Condition visible,
List<Connaissance> connaissances,
List<Objet> objetsRecus,
List<Objet> objetsConso,
List<Action> actions) {
this.visible = visible;
this.connaissances = connaissances;
this.objetsRecus = objetsRecus;
this.objetsConso = objetsConso;
this.actions = actions;
}
@Override
public String toString() {
String res = "Interraction :";
int k = 0;
for (Action a : this.actions) {
if (a.visible.evaluer()) {
res += "\n" + k + " " + a;
k++;
}
}
return res;
}
}