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

25 lines
536 B
Java
Raw Normal View History

2021-12-01 19:55:46 +00:00
import java.util.List;
import java.util.ArrayList;
public class ConditionEt {
List<ConditionTest> conditionTests;
2021-12-01 19:55:46 +00:00
public ConditionEt(ConditionTest... conditionTests) {
this.conditionTests = new ArrayList<>();
for (ConditionTest c : conditionTests) {
this.conditionTests.add(c);
}
}
public Boolean evaluer() {
for (ConditionTest cond : conditionTests) {
if (!cond.evaluer()) {
return false;
}
}
return true;
}
}