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

30 lines
653 B
Java

import java.util.List;
public class Objet {
String nom;
int taille;
Condition visible;
List<Description> descriptions;
public Objet(
String nom,
int taille,
Condition visible,
List<Description> descriptions) {
this.nom = nom;
this.taille = taille;
this.visible = visible;
this.descriptions = descriptions;
}
@Override
public String toString() {
for (Description d : this.descriptions) {
if (d.condition.evaluer()) {
return this.nom + ": " + d;
}
}
return "No desc";
}
}