projet-genie-logiciel-systeme/enigme.java/ConditionConnaissance.java
Laureηt 2b4b5433b7
feat: ajout du java
Co-authored-by: gdamms <gdamms@users.noreply.github.com>
2021-11-30 23:02:55 +01:00

20 lines
483 B
Java

public class ConditionConnaissance implements ConditionTest {
Connaissance connaissance;
Boolean negation;
public ConditionConnaissance(String connaissance, Boolean negation) {
this.connaissance = connaissance;
this.negation = negation;
}
public Boolean evaluer() {
if (Jeu.explorateur.connaissances.contains(this.connaissance)) {
return !this.negation;
} else {
return this.negation;
}
}
}