|
|
@ -38,6 +38,7 @@ public class Game { |
|
|
|
System.out.println("Spieler " + winner.name + " gewinnt!"); |
|
|
|
exit(42); |
|
|
|
} |
|
|
|
TimeUnit.SECONDS.sleep(1L); |
|
|
|
clearScreen(); |
|
|
|
} |
|
|
|
} |
|
|
@ -157,14 +158,16 @@ public class Game { |
|
|
|
*/ |
|
|
|
public int setFigure(int figId, int dice, Player p, Game g) { |
|
|
|
int preCalculated; |
|
|
|
if(p.figures.get(figId).getPosition() == -1) { |
|
|
|
if (p.figures.get(figId).getPosition() == -1) { |
|
|
|
preCalculated = p.startPos; |
|
|
|
} else if (p.figures.get(figId).getPosition() <= p.jumpToHome && (p.figures.get(figId).getPosition() + dice) > p.jumpToHome) { |
|
|
|
System.out.println(p.startHome); |
|
|
|
System.out.println(dice); |
|
|
|
System.out.println(p.jumpToHome); |
|
|
|
preCalculated = p.startHome + (dice - (p.jumpToHome - p.figures.get(figId).getPosition()) - 1); |
|
|
|
} else { |
|
|
|
} else if (p.figures.get(figId).getPosition() >= p.startHome) { |
|
|
|
preCalculated = p.figures.get(figId).getPosition() + dice; |
|
|
|
}else { |
|
|
|
preCalculated = (p.figures.get(figId).getPosition() + dice) % 40; |
|
|
|
} |
|
|
|
for(Player currentPlayer : g.players) { |
|
|
|