projet-genie-logiciel-systeme/enigme.java/Action.java
2021-12-01 20:55:46 +01:00

36 lines
972 B
Java

import java.util.List;
public class Action {
Condition visible;
List<Connaissance> connaissances;
List<Objet> objetsRecus;
List<Objet> objetsConso;
Condition finInterraction;
List<Description> descriptions;
public Action(
Condition visible,
List<Connaissance> connaissances,
List<Objet> objetsRecus,
List<Objet> objetsConso,
Condition finInterraction,
List<Description> descriptions) {
this.visible = visible;
this.connaissances = connaissances;
this.objetsRecus = objetsRecus;
this.objetsConso = objetsConso;
this.finInterraction = finInterraction;
this.descriptions = descriptions;
}
@Override
public String toString() {
for (Description d : this.descriptions) {
if (d.condition.evaluer()) {
return d.toString();
}
}
return "No desc";
}
}