Displaying.
This commit is contained in:
parent
673ea047b7
commit
25c10eee4a
@ -85,4 +85,6 @@ public abstract class CaseAbstraite {
|
||||
public void setVoisins(HashMap<PointsCardinaux, CaseAbstraite> voisins) {
|
||||
this.voisins = voisins;
|
||||
}
|
||||
|
||||
public abstract String affichageSpecial();
|
||||
}
|
@ -10,6 +10,13 @@ public class CaseColore extends CaseAbstraite {
|
||||
this.couleur = Color.WHITE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String affichageSpecial() {
|
||||
if (this.couleur.getRGB() < 0)
|
||||
return String.valueOf(String.valueOf(this.couleur.getRGB()).charAt(0));
|
||||
return " ";
|
||||
}
|
||||
|
||||
public Color getCouleur() {
|
||||
return couleur;
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ public class InterfaceConsole {
|
||||
if (plateau[i][j].getOccupant() != null) {
|
||||
System.out.print(plateau[i][j].getOccupant().getNom().charAt(0) + " | ");
|
||||
} else {
|
||||
System.out.print(" | ");
|
||||
System.out.print(" " + plateau[i][j].affichageSpecial() + " | ");
|
||||
}
|
||||
}
|
||||
System.out.println();
|
||||
|
Loading…
Reference in New Issue
Block a user