diff --git a/src/main/java/latice/application/LaticeApplicationWindow.java b/src/main/java/latice/application/LaticeApplicationWindow.java index e334ba5..81fa70d 100644 --- a/src/main/java/latice/application/LaticeApplicationWindow.java +++ b/src/main/java/latice/application/LaticeApplicationWindow.java @@ -637,6 +637,13 @@ public class LaticeApplicationWindow extends Application { tileDropped = true; freeOrPayableTile = false; System.out.println("tuile posé!"); + + + if (referee.sunRule(board, player.getRack().getListRackTile().get(indexTileClicked))) { + System.out.println("Vous avez gagné 2 points en mettant votre tuile sur un soleil"); + playerFX.setAddScore(player, 2); + + } } } } @@ -701,6 +708,7 @@ public class LaticeApplicationWindow extends Application { //setDragnDropOnRectangles(rect, board, referee, player); borderPane.setBottom(rackImage); tileDropped = false; + playerFX.setTilesRemaining(player); } } diff --git a/src/main/java/latice/model/window/PlayerFX.java b/src/main/java/latice/model/window/PlayerFX.java index 3c790bc..1a5799c 100644 --- a/src/main/java/latice/model/window/PlayerFX.java +++ b/src/main/java/latice/model/window/PlayerFX.java @@ -64,6 +64,10 @@ public class PlayerFX { this.score.setText("Score : " + player.getScore()); } + public void setTilesRemaining(Player player) { + this.nbrOfTiles.setText("Tuiles restantes : " + player.getNumberOfTilesRemaining()); + } + }