Merge branch 'Latice_Console_2.0' into 'master'

ADD method checkScoreToPlay to Rules | UPDATE LaticeApplicationConsole

See merge request odabasioglu1/latice!7
master
Odabasioglu Cemal 2022-05-31 13:13:14 +00:00
commit ee4f4451a2
2 changed files with 12 additions and 4 deletions

View File

@ -142,9 +142,9 @@ public class LaticeApplicationConsole {
int choiceMenu = Integer.parseInt(play.next()); int choiceMenu = Integer.parseInt(play.next());
switch(choiceMenu) { switch(choiceMenu) {
case 1: //if (arbitre.checkScore(freeTile)){ case 1: if (arbitre.checkScoreToPlay(player, freeTile) == false){
//System.out.println("Vous n'avez pas assez de points pour jouer un nouvelle tuile"); System.out.println("Il vous faut 2 points pour jouer un nouvelle tuile !!!");
//}else { }else {
Boolean rulesCheck = false; Boolean rulesCheck = false;
while (rulesCheck == false) { while (rulesCheck == false) {
@ -162,7 +162,7 @@ public class LaticeApplicationConsole {
player.getRack().removeTile(tile); player.getRack().removeTile(tile);
board.displayGameBoard(); board.displayGameBoard();
//} }
break; break;

View File

@ -75,6 +75,14 @@ public class Rules {
return sun; 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) { public Boolean arbitration(Player player, GameBoard board, Tile tile, Boolean start) {
if (start == true){ if (start == true){