diff --git a/src/main/java/latice/application/LaticeApplicationConsole.java b/src/main/java/latice/application/LaticeApplicationConsole.java index 75406eb..490972b 100644 --- a/src/main/java/latice/application/LaticeApplicationConsole.java +++ b/src/main/java/latice/application/LaticeApplicationConsole.java @@ -142,9 +142,9 @@ public class LaticeApplicationConsole { int choiceMenu = Integer.parseInt(play.next()); switch(choiceMenu) { - case 1: //if (arbitre.checkScore(freeTile)){ - //System.out.println("Vous n'avez pas assez de points pour jouer un nouvelle tuile"); - //}else { + case 1: if (arbitre.checkScoreToPlay(player, freeTile) == false){ + System.out.println("Il vous faut 2 points pour jouer un nouvelle tuile !!!"); + }else { Boolean rulesCheck = false; while (rulesCheck == false) { @@ -162,7 +162,7 @@ public class LaticeApplicationConsole { player.getRack().removeTile(tile); board.displayGameBoard(); - //} + } break; diff --git a/src/main/java/latice/model/Rules.java b/src/main/java/latice/model/Rules.java index 76edeb6..92ee17c 100644 --- a/src/main/java/latice/model/Rules.java +++ b/src/main/java/latice/model/Rules.java @@ -75,6 +75,14 @@ public class Rules { return sun; } + public Boolean checkScoreToPlay(Player player, Boolean free) { + if (player.getScore() < 2 && free == false) { + return false; + }else { + return true; + } + } + public Boolean arbitration(Player player, GameBoard board, Tile tile, Boolean start) { if (start == true){