Merge branch 'Latice_Console_2.0' into 'master'
ADD method checkScoreToPlay to Rules | UPDATE LaticeApplicationConsole See merge request odabasioglu1/latice!7master
commit
ee4f4451a2
|
@ -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;
|
||||
|
||||
|
||||
|
|
|
@ -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){
|
||||
|
|
Loading…
Reference in New Issue