Browse Source

Fix Checkdice

AIPlayer
FelixKrull 3 years ago
parent
commit
dd03f81fed
  1. 2
      src/main/java/Game.java
  2. 6
      src/test/java/GameTest.java

2
src/main/java/Game.java

@ -72,7 +72,7 @@ public class Game {
*/ */
public boolean checkDice(int dice, Player p, int countRolls, Game g) { public boolean checkDice(int dice, Player p, int countRolls, Game g) {
int figuresInBase = p.checkFigureInBase(p.figures); int figuresInBase = p.checkFigureInBase(p.figures);
if(countRolls >= 3) return false;
if(countRolls >= 3) return dice == 6;
if(figuresInBase == 4) { if(figuresInBase == 4) {
return true; return true;
} else if (figuresInBase < 4) { } else if (figuresInBase < 4) {

6
src/test/java/GameTest.java

@ -87,6 +87,12 @@ public class GameTest {
5, 5,
1, 1,
true true
),
Arguments.of("Figures on Field - d: 6 - c: 1",
Arrays.asList(0, -1, -1, -1),
6,
3,
true
) )
); );
} }

Loading…
Cancel
Save