2021-11-30 22:02:55 +00:00
|
|
|
public class ConditionConnaissance implements ConditionTest {
|
|
|
|
|
|
|
|
Connaissance connaissance;
|
|
|
|
Boolean negation;
|
|
|
|
|
2021-12-01 08:09:27 +00:00
|
|
|
public ConditionConnaissance(
|
|
|
|
Connaissance connaissance,
|
|
|
|
Boolean negation) {
|
2021-11-30 22:02:55 +00:00
|
|
|
this.connaissance = connaissance;
|
|
|
|
this.negation = negation;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Boolean evaluer() {
|
|
|
|
if (Jeu.explorateur.connaissances.contains(this.connaissance)) {
|
|
|
|
return !this.negation;
|
|
|
|
} else {
|
|
|
|
return this.negation;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|