New Pokergame now also gets started correctly

main
Jakob 2025-01-09 13:55:49 +01:00
parent 91423b880e
commit fc665499d0
2 changed files with 7 additions and 7 deletions

View File

@ -21,7 +21,7 @@ public class Main {
bb.put(new ConsolePokerPlayer("Jakob4"), 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();

View File

@ -295,14 +295,13 @@ public class PokerGame {
while (running && (!areAllBetsEqual() || !allPlayersHaveActed())) {
System.out.println("DEBUG");
System.out.println("DEBUG:");
System.out.println("Are all bets equal?: " + areAllBetsEqual());
System.out.println("Have all players acted: " + allPlayersHaveActed());
PokerPlayer actingPlayer = players[playerActing];
//correct action check
for (PokerPlayer player : betsThisRound.keySet()) {
boolean folded = false;
@ -697,9 +696,9 @@ public class PokerGame {
private void endGame() {
rounds--;
if (rounds > 0) {
rounds--;
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;
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 {
caster.allRoundsPlayed();