Browse Source

Change condition of checkDice

develop
FelixKrull 2 years ago
parent
commit
6643e1d08e
  1. 10
      src/main/java/Game.java

10
src/main/java/Game.java

@ -66,8 +66,14 @@ public class Game {
* @return true if Player can roll the dice another time
*/
public boolean checkDice(int dice, Player p, int countRolls) {
int figuresInBase = p.checkFigureInBase(p.figures);
if(figuresInBase == 4) {
boolean figuresOnBoard = false;
for(Figure f : p.figures) {
if (f.getPosition() > -1 && f.getPosition() < 40) {
figuresOnBoard = true;
break;
}
}
if(!figuresOnBoard) {
return countRolls < 3;
} else return dice == 6;
}

Loading…
Cancel
Save