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

36 lines
972 B
Java
Raw Normal View History

2021-12-01 19:55:46 +00:00
import java.util.List;
public class Action {
2021-12-01 19:55:46 +00:00
Condition visible;
2021-12-01 07:58:07 +00:00
List<Connaissance> connaissances;
List<Objet> objetsRecus;
List<Objet> objetsConso;
Condition finInterraction;
2021-12-01 19:55:46 +00:00
List<Description> descriptions;
public Action(
2021-12-01 19:55:46 +00:00
Condition visible,
List<Connaissance> connaissances,
List<Objet> objetsRecus,
2021-12-01 07:58:07 +00:00
List<Objet> objetsConso,
2021-12-01 19:55:46 +00:00
Condition finInterraction,
List<Description> descriptions) {
this.visible = visible;
2021-12-01 19:55:46 +00:00
this.connaissances = connaissances;
this.objetsRecus = objetsRecus;
this.objetsConso = objetsConso;
2021-12-01 07:58:07 +00:00
this.finInterraction = finInterraction;
2021-12-01 19:55:46 +00:00
this.descriptions = descriptions;
}
@Override
public String toString() {
for (Description d : this.descriptions) {
if (d.condition.evaluer()) {
return d.toString();
}
}
return "No desc";
}
}