Changements vide => new piece + autres modif annexes
This commit is contained in:
parent
7a021bdfff
commit
1f47ab7850
@ -55,7 +55,7 @@ public class Echiquier {
|
||||
|
||||
// A choisir soit on enleve abstract de piece pour avoir le vide soit on garde la classe vide
|
||||
//private Vide vide = new Vide();
|
||||
private Piece vide = new Piece();
|
||||
//private Piece vide = new Piece();
|
||||
|
||||
private Piece[][] echiquier =
|
||||
{
|
||||
@ -122,7 +122,7 @@ public class Echiquier {
|
||||
j++;
|
||||
if (getCodes()[i][j].equals(A))
|
||||
{
|
||||
if (this.getEchiquier()[i][j] == vide)
|
||||
if (this.getEchiquier()[i][j].getClass().getName().equals("Piece"))
|
||||
{
|
||||
System.out.println("Vous avez choisi une case vide. Recommencez.");
|
||||
return false;
|
||||
@ -163,7 +163,7 @@ public class Echiquier {
|
||||
{
|
||||
System.out.println("Choix validés. Déplacement en cours.");
|
||||
this.getEchiquier()[k][l] = this.getEchiquier()[i][j];
|
||||
this.getEchiquier()[i][j] = vide;
|
||||
this.getEchiquier()[i][j] = new Piece(new Position(i,j));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,7 @@ public class Piece {
|
||||
private String emp;
|
||||
private char lettre = '.';
|
||||
private boolean enVie = true;
|
||||
private Position position = new Position(0,0);
|
||||
private Position position;
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user