diff --git a/bin/domain/Hand.class b/bin/domain/Hand.class index 3fafdcd..e8f03e9 100644 Binary files a/bin/domain/Hand.class and b/bin/domain/Hand.class differ diff --git a/bin/facade/YahtzeeGame.class b/bin/facade/YahtzeeGame.class index 3e74296..ced5c5a 100644 Binary files a/bin/facade/YahtzeeGame.class and b/bin/facade/YahtzeeGame.class differ diff --git a/bin/ui/TUI.class b/bin/ui/TUI.class index 658fe17..8d9a00b 100644 Binary files a/bin/ui/TUI.class and b/bin/ui/TUI.class differ diff --git a/src/domain/Hand.java b/src/domain/Hand.java index b394453..4bede5d 100644 --- a/src/domain/Hand.java +++ b/src/domain/Hand.java @@ -41,7 +41,7 @@ public class Hand { } } - public void autoLockInDices() { + public boolean autoLockInDices() { int mem = this.dices.size(); @@ -50,10 +50,10 @@ public class Hand { for (int i = 0; i < mem; i++) { lockInDice(dices.get(0).getDiceNumber()); } - - System.out.println("No rolls left, auto locking in all left dices..."); + return true; + } - + return false; } public int getLockedInDiceAmount() { diff --git a/src/facade/YahtzeeGame.java b/src/facade/YahtzeeGame.java index 96cbb9e..786e8c1 100644 --- a/src/facade/YahtzeeGame.java +++ b/src/facade/YahtzeeGame.java @@ -76,9 +76,9 @@ public class YahtzeeGame { } - public void autoLockInDices(int player) { + public boolean autoLockInDices(int player) { - players.get(player).hand.autoLockInDices(); + return players.get(player).hand.autoLockInDices(); } diff --git a/src/ui/TUI.java b/src/ui/TUI.java index a6d584b..b0ba1c0 100644 --- a/src/ui/TUI.java +++ b/src/ui/TUI.java @@ -84,7 +84,9 @@ public class TUI { System.out.println("Free dices: " + game.getFreeDiceNumbers(i)); System.out.println("Locked in dices: " + game.getLockedInDiceNumbers(i)); - game.autoLockInDices(i); + if(game.autoLockInDices(i)){ + System.out.println("\nNo rolls left auto locking dices....\n"); + } if (!game.noMoreRolls(i)) { System.out.println( "Type in which free dices you want to keep \n(seperated by space, type 'none' if you dont want to keep any): ");