Working on restoring betting code.
This commit is contained in:
@ -13,9 +13,8 @@ void _pokerGameActionBetOnStart(
|
||||
bool isHuman;
|
||||
pokergame_t *game = (pokergame_t *)action->data;
|
||||
|
||||
//TODO: Fix this whole filee
|
||||
// Reset the UI state.
|
||||
// isHuman = game->poker.bet.better == POKER_PLAYER_HUMAN_INDEX;
|
||||
isHuman = game->poker.better == POKER_WORLD_HUMAN_INDEX;
|
||||
// if(isHuman) pokerUiBetShow(&game->ui);
|
||||
}
|
||||
|
||||
@ -23,37 +22,37 @@ void _pokerGameActionBetOnUpdate(
|
||||
queue_t *queue, queueaction_t *action, uint8_t i
|
||||
) {
|
||||
// Restack
|
||||
// bool isHuman;
|
||||
// bool turnMade = false;
|
||||
// pokerturn_t turn;
|
||||
// pokergame_t *game = (pokergame_t *)action->data;
|
||||
// pokerplayer_t *player;
|
||||
// pokerdiscussiondata_t discussion;
|
||||
bool isHuman;
|
||||
bool turnMade = false;
|
||||
pokerturn_t turn;
|
||||
pokergame_t *game = (pokergame_t *)action->data;
|
||||
pokerplayer_t *player;
|
||||
pokerdiscussiondata_t discussion;
|
||||
|
||||
// // Are they human?
|
||||
// player = game->poker.players + game->poker.bet.better;
|
||||
// isHuman = game->poker.bet.better == POKER_PLAYER_HUMAN_INDEX;
|
||||
// Are they human?
|
||||
player = game->poker.players + game->poker.better;
|
||||
isHuman = game->poker.better == POKER_WORLD_HUMAN_INDEX;
|
||||
|
||||
// // Handle as an AI
|
||||
// if(isHuman) {
|
||||
// turn = game->ui.betTurn;
|
||||
// turnMade = game->ui.betTurnMade;
|
||||
// } else {
|
||||
// turn = pokerTurnGet(&game->poker, game->poker.bet.better);
|
||||
// turnMade = true;
|
||||
// }
|
||||
// Handle as an AI
|
||||
if(isHuman) {
|
||||
// turn = game->ui.betTurn;
|
||||
// turnMade = game->ui.betTurnMade;
|
||||
} else {
|
||||
turn = pokerTurnGetForPlayer(&game->poker, game->poker.better);
|
||||
turnMade = true;
|
||||
}
|
||||
|
||||
// // Now decide if we should do something.
|
||||
// if(!turnMade) return;
|
||||
// Now decide if we should do something.
|
||||
if(!turnMade) return;
|
||||
|
||||
// // Perform the action
|
||||
// Perform the action
|
||||
// pokerTurnAction(&game->poker, player, &turn);
|
||||
|
||||
// // Speak
|
||||
// Speak
|
||||
// discussion.reason = pokerDiscussionGetTypeFromTurnType(turn.type);
|
||||
// discussion.poker = game;
|
||||
// discussion.playerCause = game->poker.bet.better;
|
||||
// pokerDiscussionQueue(&discussion);
|
||||
discussion.poker = game;
|
||||
discussion.playerCause = game->poker.better;
|
||||
pokerDiscussionQueue(&discussion);
|
||||
|
||||
// Next.
|
||||
queueNext(queue);
|
||||
|
@ -37,16 +37,15 @@ void _pokerGameActionFlopOnStart(
|
||||
// Now, get the count of players left to bet. If "everyone is all in" then
|
||||
// this will be 0 and no actual betting needs to happen.
|
||||
|
||||
// if(pokerBetGetRemainingPlayerCount(
|
||||
// &game->poker.bet, game->poker.players
|
||||
// ) > 1) {
|
||||
// // Begin betting.
|
||||
// pokerGameActionLookAdd(game, game->poker.bet.better);
|
||||
// pokerGameActionBetAdd(game);
|
||||
// } else {
|
||||
// //No actual players to bet, so add the following flop instead.
|
||||
// pokerGameActionFlopAdd(game);
|
||||
// }
|
||||
if(nextBetter != 0xFF) {
|
||||
// Begin betting.
|
||||
game->poker.better = nextBetter;
|
||||
pokerGameActionLookAdd(game, nextBetter);
|
||||
pokerGameActionBetAdd(game);
|
||||
} else {
|
||||
//No actual players to bet, so add the following flop instead.
|
||||
pokerGameActionFlopAdd(game);
|
||||
}
|
||||
|
||||
// Do next action.
|
||||
queueNext(queue);
|
||||
|
Reference in New Issue
Block a user