New Pokergame now also gets started correctly
parent
91423b880e
commit
fc665499d0
|
|
@ -21,7 +21,7 @@ public class Main {
|
||||||
bb.put(new ConsolePokerPlayer("Jakob4"), 10f);
|
bb.put(new ConsolePokerPlayer("Jakob4"), 10f);
|
||||||
bb.put(new ConsolePokerPlayer("Jakob5"), 10f);
|
bb.put(new ConsolePokerPlayer("Jakob5"), 10f);
|
||||||
|
|
||||||
PokerGame game = new PokerGame(new ConsoleBroadcaster(), 1, bb, 0);
|
PokerGame game = new PokerGame(new ConsoleBroadcaster(), 2, bb, 0);
|
||||||
|
|
||||||
game.start();
|
game.start();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -295,14 +295,13 @@ public class PokerGame {
|
||||||
|
|
||||||
while (running && (!areAllBetsEqual() || !allPlayersHaveActed())) {
|
while (running && (!areAllBetsEqual() || !allPlayersHaveActed())) {
|
||||||
|
|
||||||
System.out.println("DEBUG");
|
System.out.println("DEBUG:");
|
||||||
System.out.println("Are all bets equal?: " + areAllBetsEqual());
|
System.out.println("Are all bets equal?: " + areAllBetsEqual());
|
||||||
System.out.println("Have all players acted: " + allPlayersHaveActed());
|
System.out.println("Have all players acted: " + allPlayersHaveActed());
|
||||||
|
|
||||||
PokerPlayer actingPlayer = players[playerActing];
|
PokerPlayer actingPlayer = players[playerActing];
|
||||||
|
|
||||||
//correct action check
|
//correct action check
|
||||||
|
|
||||||
for (PokerPlayer player : betsThisRound.keySet()) {
|
for (PokerPlayer player : betsThisRound.keySet()) {
|
||||||
|
|
||||||
boolean folded = false;
|
boolean folded = false;
|
||||||
|
|
@ -697,9 +696,9 @@ public class PokerGame {
|
||||||
|
|
||||||
private void endGame() {
|
private void endGame() {
|
||||||
|
|
||||||
|
rounds--;
|
||||||
|
|
||||||
if (rounds > 0) {
|
if (rounds > 0) {
|
||||||
rounds--;
|
|
||||||
|
|
||||||
LinkedHashMap<PokerPlayer, Float> newbbPerPlayer = new LinkedHashMap<>();
|
LinkedHashMap<PokerPlayer, Float> newbbPerPlayer = new LinkedHashMap<>();
|
||||||
|
|
||||||
|
|
@ -721,8 +720,7 @@ public class PokerGame {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//schwierig wenn unten Leute wegfallen und es nochmal der gleiche Dealer ist oder es sogar zur<75>ck geht
|
|
||||||
int newdealerPosition = dealerPosition + 1;
|
int newdealerPosition = dealerPosition + 1;
|
||||||
|
|
||||||
if (newdealerPosition >= newbbPerPlayer.size()) {
|
if (newdealerPosition >= newbbPerPlayer.size()) {
|
||||||
|
|
@ -730,7 +728,9 @@ public class PokerGame {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
new PokerGame(new ConsoleBroadcaster(), rounds, newbbPerPlayer, newdealerPosition);
|
PokerGame nextGame = new PokerGame(new ConsoleBroadcaster(), rounds, newbbPerPlayer, newdealerPosition);
|
||||||
|
|
||||||
|
nextGame.start();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
caster.allRoundsPlayed();
|
caster.allRoundsPlayed();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue