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

25 lines
536 B
Java

import java.util.List;
import java.util.ArrayList;
public class ConditionEt {
List<ConditionTest> conditionTests;
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;
}
}