import java.util.ArrayList; import java.util.Iterator; public class Game { Gameboard gb; ArrayList players; public static void main(String[] args) { Game g = new Game(); while(true){ for (Player p : g.players) { int c = 0; int dice; do { dice = p.rollDice(); c++; if(p.checkFigureInBase(p.figures) == 4 && dice == 6) { //choose //moveToStart } else { //choose //moveToDice } } while (g.checkDice(dice, p, c)); p.checkGameWin(p.figures); } } } public Game() { this.gb = new Gameboard(); gb.initGameboard(); players = new ArrayList<>(); players.add(new Player("Rot", 40, 43)); players.add(new Player("Blau", 44, 47)); players.add(new Player("Gelb", 48, 51)); players.add(new Player("GrĂ¼n", 52, 55)); } public boolean checkDice(int dice, Player p, int countRolls) { int figuresInBase = p.checkFigureInBase(p.figures); if(figuresInBase == 4) { return countRolls <= 3; } else return dice == 6; } }