|
@ -66,8 +66,14 @@ public class Game { |
|
|
* @return true if Player can roll the dice another time |
|
|
* @return true if Player can roll the dice another time |
|
|
*/ |
|
|
*/ |
|
|
public boolean checkDice(int dice, Player p, int countRolls) { |
|
|
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; |
|
|
return countRolls < 3; |
|
|
} else return dice == 6; |
|
|
} else return dice == 6; |
|
|
} |
|
|
} |
|
|