From b3405ceecb526ee3ff3dc5b065a812f148c9dae4 Mon Sep 17 00:00:00 2001 From: lrave Date: Tue, 6 May 2025 14:36:43 +0200 Subject: [PATCH 1/3] comment on user touch start game --- src/backend/Board.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/Board.java b/src/backend/Board.java index 1dd976e..de0cc85 100644 --- a/src/backend/Board.java +++ b/src/backend/Board.java @@ -157,7 +157,7 @@ public class Board { // user clicks on the board public void userTouch(int x, int y) { - if (selectedX == -1 && selectedY == -1) { + if (selectedX == -1 && selectedY == -1) { // ******REVIEW****** Faudrait pas mettre || ? // check if the position is empty and the color if (board[x][y] != null && board[x][y].isWhite() == isTurnWhite()) { // select it as active location From c0cc47cf563bb557b8c63cc71dadf59c32caaee8 Mon Sep 17 00:00:00 2001 From: lrave Date: Tue, 6 May 2025 14:48:39 +0200 Subject: [PATCH 2/3] console class created --- src/backend/Board.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/Board.java b/src/backend/Board.java index de0cc85..24cc72b 100644 --- a/src/backend/Board.java +++ b/src/backend/Board.java @@ -157,7 +157,7 @@ public class Board { // user clicks on the board public void userTouch(int x, int y) { - if (selectedX == -1 && selectedY == -1) { // ******REVIEW****** Faudrait pas mettre || ? + if (selectedX == -1 && selectedY == -1) { // This condition is only possible at the very start of the game // check if the position is empty and the color if (board[x][y] != null && board[x][y].isWhite() == isTurnWhite()) { // select it as active location @@ -167,7 +167,7 @@ public class Board { } } else { if (x == selectedX && y == selectedY) { - // unselect it + // unselect it if the destination is unvalid (not highlighted) selectedX = -1; selectedY = -1; highlightedPositions.clear(); From b18bd1c46bebd48a5fba7ef52a125fddddc9e1fd Mon Sep 17 00:00:00 2001 From: lrave Date: Tue, 6 May 2025 14:50:07 +0200 Subject: [PATCH 3/3] clear console comment --- src/backend/Board.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/Board.java b/src/backend/Board.java index 24cc72b..d21b0ac 100644 --- a/src/backend/Board.java +++ b/src/backend/Board.java @@ -91,7 +91,7 @@ public class Board { } } - private void clearConsole() { + private void clearConsole() { // ***************CONSOLE for (int i = 0; i < 50; i++) { System.out.println(); // Print 50 empty lines to "clear" the console }