projet-genie-logiciel-systeme/runtime-workspace/fr.n7.game.examples/src-gen/Objet.java

32 lines
701 B
Java
Raw Normal View History

2021-12-09 17:54:08 +00:00
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() {
2022-01-16 17:14:57 +00:00
String str = null;
2021-12-09 17:54:08 +00:00
for (Description d : this.descriptions) {
if (d.condition.evaluer()) {
2022-01-16 17:14:57 +00:00
str = this.nom + "(" + d + ")";
break;
2021-12-09 17:54:08 +00:00
}
}
2022-01-16 17:14:57 +00:00
return str;
2021-12-09 17:54:08 +00:00
}
}