projet-genie-logiciel-systeme/enigme.java/Interaction.java

36 lines
901 B
Java
Raw Normal View History

2021-12-01 19:55:46 +00:00
import java.util.List;
2021-12-01 07:58:07 +00:00
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;
}
2021-12-01 19:55:46 +00:00
@Override
public String toString() {
2021-12-01 20:19:08 +00:00
String res = "Interraction :";
2021-12-01 19:55:46 +00:00
int k = 0;
2021-12-01 20:19:08 +00:00
for (Action a : this.actions) {
2021-12-01 19:55:46 +00:00
if (a.visible.evaluer()) {
2021-12-01 20:19:08 +00:00
res += "\n" + k + " " + a;
2021-12-01 19:55:46 +00:00
k++;
}
}
2021-12-01 20:19:08 +00:00
return res;
2021-12-01 19:55:46 +00:00
}
2021-12-01 07:58:07 +00:00
}