debugging using toString
This commit is contained in:
parent
0463a29d8d
commit
a7d7f5a7dc
|
|
@ -42,6 +42,7 @@ public class Board {
|
|||
|
||||
// Create and place the new piece
|
||||
board[x][y] = new Piece(isWhite, type, x, y);
|
||||
System.out.println(toString()); // Work but not sure ?
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -77,8 +78,7 @@ public class Board {
|
|||
public void cleanBoard() {
|
||||
turn = 0;
|
||||
this.board = new Piece[width][height]; // should work ?
|
||||
//this.isTurnWhite = true;
|
||||
} // force
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
|
@ -125,7 +125,7 @@ public class Board {
|
|||
selectedY = y;
|
||||
}
|
||||
} else {
|
||||
// Clicked the same piece again → unselect
|
||||
// Clicked the same piece again : unselect
|
||||
if (x == selectedX && y == selectedY) {
|
||||
selectedX = -1;
|
||||
selectedY = -1;
|
||||
|
|
@ -143,6 +143,8 @@ public class Board {
|
|||
|
||||
selectedX = -1;
|
||||
selectedY = -1; // Unselect
|
||||
|
||||
System.out.println(toString()); // Work but not sure ?
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue