From f832d549118579b781245b5b02c0e267b76afc92 Mon Sep 17 00:00:00 2001 From: cemal Date: Tue, 7 Jun 2022 14:35:48 +0200 Subject: [PATCH] added tests and few bugfixes --- .../application/LaticeApplicationWindow.java | 2 +- src/main/java/latice/model/Player.java | 8 +- src/main/java/latice/model/Rules.java | 3 +- src/main/java/latice/model/console/Rack.java | 6 - .../java/latice/view/GameFinishedScreen.fxml | 4 +- src/test/java/latice/LaticeTest.java | 265 +++++++++++++++++- 6 files changed, 265 insertions(+), 23 deletions(-) diff --git a/src/main/java/latice/application/LaticeApplicationWindow.java b/src/main/java/latice/application/LaticeApplicationWindow.java index 14fca7b..f1f376e 100644 --- a/src/main/java/latice/application/LaticeApplicationWindow.java +++ b/src/main/java/latice/application/LaticeApplicationWindow.java @@ -353,7 +353,7 @@ public class LaticeApplicationWindow extends Application { } - private void switchToGameFinishedScreen() throws IOException { + public void switchToGameFinishedScreen() throws IOException { //switching to game finished screen if the game finishes System.out.println("confirmBtnClickedCount : " + confirmBtnClickedCount); diff --git a/src/main/java/latice/model/Player.java b/src/main/java/latice/model/Player.java index 13a53d0..320b93f 100644 --- a/src/main/java/latice/model/Player.java +++ b/src/main/java/latice/model/Player.java @@ -63,7 +63,7 @@ public class Player { } - System.out.print("Quel tuile voulez-vous jouez ? "); + System.out.print("Quelle tuile voulez-vous jouez ? "); this.rack.displayRack(); Integer idTileToPlay = Integer.parseInt(play.next())-1; Tile tileToPlay = this.rack.getListRackTile().get(idTileToPlay); @@ -75,12 +75,6 @@ public class Player { tileToPlay.setPosition(new Position(row, column)); return tileToPlay; - //.setGridBoard(" "+tileToPlay.getShapeConsole()+tileToPlay.getColorConsole()+" ", row, column); - //this.rack.removeTile(tileToPlay); - - //board.displayGameBoard(); - - //this.rack.updateRack(); } diff --git a/src/main/java/latice/model/Rules.java b/src/main/java/latice/model/Rules.java index 018a811..d7966f2 100644 --- a/src/main/java/latice/model/Rules.java +++ b/src/main/java/latice/model/Rules.java @@ -6,10 +6,9 @@ import java.util.regex.Pattern; import latice.model.console.GameBoard; public class Rules { - //private static boolean START = true; public Rules() { - // TODO Auto-generated constructor stub + } public Boolean moonRule(GameBoard board, Tile tile) { diff --git a/src/main/java/latice/model/console/Rack.java b/src/main/java/latice/model/console/Rack.java index 6f6c8c5..041c33f 100644 --- a/src/main/java/latice/model/console/Rack.java +++ b/src/main/java/latice/model/console/Rack.java @@ -158,11 +158,5 @@ public class Rack { } - - - - - // TODO add method(s) javafx - } diff --git a/src/main/java/latice/view/GameFinishedScreen.fxml b/src/main/java/latice/view/GameFinishedScreen.fxml index fdd45d4..d7d2608 100644 --- a/src/main/java/latice/view/GameFinishedScreen.fxml +++ b/src/main/java/latice/view/GameFinishedScreen.fxml @@ -13,9 +13,9 @@ -