Working on poker logic.

This commit is contained in:
2021-09-25 01:36:25 -07:00
parent e1a4abaaf8
commit 1bccf9b7e2
7 changed files with 222 additions and 74 deletions

View File

@ -116,20 +116,24 @@ void _pokerGameActionBetOnEnd(
// Not waiting, restack and do next action.
printf("Not waiting on anything!\n");
// No! Begin the next flop.
next = pokerActionNextFlopAdd(queue, &game->poker);
if(next != NULL) {
discussion.reason = POKER_DISCUSSION_REASON_FLOP;
pokerDiscussionQueue(&discussion);
// Is there a next round, or did someone just win?
if(pokerBetGetRemainingPlayerCount(&game->poker.bet,game->poker.players) > 1){
// No! Begin the next flop.
next = pokerActionNextFlopAdd(queue, &game->poker);
if(next != NULL) {
discussion.reason = POKER_DISCUSSION_REASON_FLOP;
pokerDiscussionQueue(&discussion);
pokerBetResetBetter(
&game->poker.bet, game->poker.players, game->poker.roundSmallBlind
);
pokerGameActionRestackAdd(game);
pokerGameActionLookAdd(game, game->poker.bet.better);
pokerGameActionBetAdd(game);
return;
pokerBetResetBetter(
&game->poker.bet, game->poker.players, game->poker.roundSmallBlind
);
pokerGameActionRestackAdd(game);
pokerGameActionLookAdd(game, game->poker.bet.better);
pokerGameActionBetAdd(game);
return;
}
}
// Done betting
printf("All betting is done, reveal\n");