Moved GUI out of GUI.

This commit is contained in:
2021-08-30 09:38:24 -07:00
parent 7628417b72
commit 5369795134
45 changed files with 77 additions and 935 deletions

View File

@ -34,47 +34,41 @@ void _pokerGameActionBetOnUpdate(
// Now decide if we should do something.
if(!turnMade) return;
// What happened?
char *debugAction;
switch(turn.type) {
// Player bets
case POKER_TURN_TYPE_BET:
debugAction = "betting";
//TODO: Is it a BET or a CALL?
discussion.reason = POKER_DISCUSSION_REASON_PLAYER_RAISING;
pokerBetPlayer(&game->poker, player, turn.chips);
break;
// Player folds
case POKER_TURN_TYPE_FOLD:
debugAction = "folding";
discussion.reason = POKER_DISCUSSION_REASON_PLAYER_FOLDING;
player->state |= POKER_PLAYER_STATE_FOLDED;
break;
// Player checks
case POKER_TURN_TYPE_CHECK:
discussion.reason = POKER_DISCUSSION_REASON_PLAYER_CHECKING;
debugAction = "checking";
break;
// Player may be out
default:
discussion.reason = POKER_DISCUSSION_REASON_TEST;
debugAction = "doing nothing";
break;
}
// Mark as move made.
player->state |= POKER_PLAYER_STATE_ROUND_MOVE;
// Perform the action
pokerTurnAction(&game->poker, player, &turn);
// Speak
switch(turn.type) {
case POKER_TURN_TYPE_BET:
discussion.reason = POKER_DISCUSSION_REASON_PLAYER_RAISING;
break;
case POKER_TURN_TYPE_CALL:
discussion.reason = POKER_DISCUSSION_REASON_PLAYER_CALLING;
break;
case POKER_TURN_TYPE_ALL_IN:
discussion.reason = POKER_DISCUSSION_REASON_PLAYER_CALLING;
break;
case POKER_TURN_TYPE_FOLD:
discussion.reason = POKER_DISCUSSION_REASON_PLAYER_FOLDING;
break;
case POKER_TURN_TYPE_CHECK:
discussion.reason = POKER_DISCUSSION_REASON_PLAYER_CHECKING;
break;
default:
discussion.reason = POKER_DISCUSSION_REASON_TEST;
break;
}
discussion.poker = game;
discussion.playerCause = game->poker.bet.better;
pokerDiscussionQueue(&discussion);
// Next.
printf("Player %i is %s.\n", game->poker.bet.better, debugAction);
queueNext(queue);
}