autoLockIn fix
parent
e2d9e58c35
commit
936474c659
Binary file not shown.
Binary file not shown.
BIN
bin/ui/TUI.class
BIN
bin/ui/TUI.class
Binary file not shown.
|
@ -41,7 +41,7 @@ public class Hand {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void autoLockInDices() {
|
public boolean autoLockInDices() {
|
||||||
|
|
||||||
int mem = this.dices.size();
|
int mem = this.dices.size();
|
||||||
|
|
||||||
|
@ -50,10 +50,10 @@ public class Hand {
|
||||||
for (int i = 0; i < mem; i++) {
|
for (int i = 0; i < mem; i++) {
|
||||||
lockInDice(dices.get(0).getDiceNumber());
|
lockInDice(dices.get(0).getDiceNumber());
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
|
|
||||||
System.out.println("No rolls left, auto locking in all left dices...");
|
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getLockedInDiceAmount() {
|
public int getLockedInDiceAmount() {
|
||||||
|
|
|
@ -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();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -84,7 +84,9 @@ public class TUI {
|
||||||
System.out.println("Free dices: " + game.getFreeDiceNumbers(i));
|
System.out.println("Free dices: " + game.getFreeDiceNumbers(i));
|
||||||
System.out.println("Locked in dices: " + game.getLockedInDiceNumbers(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)) {
|
if (!game.noMoreRolls(i)) {
|
||||||
System.out.println(
|
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): ");
|
"Type in which free dices you want to keep \n(seperated by space, type 'none' if you dont want to keep any): ");
|
||||||
|
|
Loading…
Reference in New Issue