32 lines
701 B
Java
32 lines
701 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() {
|
|
String str = null;
|
|
for (Description d : this.descriptions) {
|
|
if (d.condition.evaluer()) {
|
|
str = this.nom + "(" + d + ")";
|
|
break;
|
|
}
|
|
}
|
|
return str;
|
|
}
|
|
}
|