Browse Source

Rewrite GameLoop with new methods

AIPlayer
FelixKrull 2 years ago
parent
commit
ba2cfb3854
  1. 25
      src/main/java/Game.java

25
src/main/java/Game.java

@ -14,32 +14,11 @@ public class Game {
do {
dice = p.rollDice();
/*
= Done rolldice()
--> dice(1-6)
= List<Integer> getUsableFigures (dice, g, p)
--> {0,1,2,3}
int choose(List<Integer> figs, p)
--> 1
setFigure (p.figures.get(1), dice, g, p)
--> nächster Spieler
*/
c++;
//g.checkFieldClear(p.startPos, p, g)
if(p.checkFigureInBase(p.figures) > 0 && dice == 6) {
int figId = p.choose() - 1;
//checkIfKicked
ArrayList<Integer> usableFigures = g.getUsableFigures(dice, p, g);
int figId = p.choose(usableFigures);
p.figures.get(figId).setPosition(p.startPos);
} else {
int figId = p.choose() - 1;
//moveToDice
}
} while (g.checkDice(dice, p, c));
p.checkGameWin(p.figures);
}
}

Loading…
Cancel
Save