projet-genie-logiciel-systeme/runtime-workspace/fr.n7.game.examples/src-gen/Objet.java
2022-01-18 23:29:53 +01:00

31 lines
669 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 description)";
}
}