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