|
@ -15,12 +15,14 @@ public class Game { |
|
|
for (Player p : g.players) { |
|
|
for (Player p : g.players) { |
|
|
int c = 0; |
|
|
int c = 0; |
|
|
int dice; |
|
|
int dice; |
|
|
System.out.println("Spieler " + p.name + " an der Reihe."); |
|
|
|
|
|
do { |
|
|
do { |
|
|
|
|
|
clearScreen(); |
|
|
int figId; |
|
|
int figId; |
|
|
dice = p.rollDice(); |
|
|
dice = p.rollDice(); |
|
|
TimeUnit.SECONDS.sleep(1L); |
|
|
|
|
|
|
|
|
System.out.println(g.printGameboard(g,p,dice)); |
|
|
|
|
|
TimeUnit.MILLISECONDS.sleep(600L); |
|
|
System.out.println("Würfel: "+ dice); |
|
|
System.out.println("Würfel: "+ dice); |
|
|
|
|
|
TimeUnit.MILLISECONDS.sleep(600L); |
|
|
c++; |
|
|
c++; |
|
|
ArrayList<Integer> usableFigures = g.getUsableFigures(dice, p, g); |
|
|
ArrayList<Integer> usableFigures = g.getUsableFigures(dice, p, g); |
|
|
if(usableFigures.size() > 0) { |
|
|
if(usableFigures.size() > 0) { |
|
@ -28,6 +30,8 @@ public class Game { |
|
|
figId = p.choose(usableFigures); |
|
|
figId = p.choose(usableFigures); |
|
|
} while(figId == -1); |
|
|
} while(figId == -1); |
|
|
g.setFigure(figId, dice, p, g); |
|
|
g.setFigure(figId, dice, p, g); |
|
|
|
|
|
clearScreen(); |
|
|
|
|
|
System.out.println(g.printGameboard(g,p,dice)); |
|
|
} |
|
|
} |
|
|
} while (g.checkDice(dice, p, c)); |
|
|
} while (g.checkDice(dice, p, c)); |
|
|
if(p.checkGameWin(p.figures)) { |
|
|
if(p.checkGameWin(p.figures)) { |
|
@ -49,8 +53,8 @@ public class Game { |
|
|
players.add(new Player("Grün",30, 52, 29)); |
|
|
players.add(new Player("Grün",30, 52, 29)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public String printGameboard(Game g, Player p) { |
|
|
|
|
|
return gb.printBoard(g, p); |
|
|
|
|
|
|
|
|
public String printGameboard(Game g, Player p, int dice) { |
|
|
|
|
|
return gb.printBoard(g, p, dice); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public static void clearScreen() { |
|
|
public static void clearScreen() { |
|
|