Still working on updating code to new poker code.
This commit is contained in:
@ -13,46 +13,47 @@ 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;
|
||||
if(isHuman) pokerUiBetShow(&game->ui);
|
||||
// isHuman = game->poker.bet.better == POKER_PLAYER_HUMAN_INDEX;
|
||||
// if(isHuman) pokerUiBetShow(&game->ui);
|
||||
}
|
||||
|
||||
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.bet.better;
|
||||
// isHuman = game->poker.bet.better == POKER_PLAYER_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 = pokerTurnGet(&game->poker, game->poker.bet.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
|
||||
pokerTurnAction(&game->poker, player, &turn);
|
||||
// // Perform the action
|
||||
// pokerTurnAction(&game->poker, player, &turn);
|
||||
|
||||
// Speak
|
||||
discussion.reason = pokerDiscussionGetTypeFromTurnType(turn.type);
|
||||
discussion.poker = game;
|
||||
discussion.playerCause = game->poker.bet.better;
|
||||
pokerDiscussionQueue(&discussion);
|
||||
// // Speak
|
||||
// discussion.reason = pokerDiscussionGetTypeFromTurnType(turn.type);
|
||||
// discussion.poker = game;
|
||||
// discussion.playerCause = game->poker.bet.better;
|
||||
// pokerDiscussionQueue(&discussion);
|
||||
|
||||
// Next.
|
||||
queueNext(queue);
|
||||
@ -63,20 +64,20 @@ void _pokerGameActionBetOnEnd(
|
||||
) {
|
||||
pokergame_t *game = (pokergame_t *)action->data;
|
||||
|
||||
// Get which player is remaining to move.
|
||||
game->poker.bet.better = pokerBetGetRemainingPlayer(
|
||||
&game->poker.bet, game->poker.players, game->poker.roundSmallBlind
|
||||
);
|
||||
// // Get which player is remaining to move.
|
||||
// game->poker.bet.better = pokerBetGetRemainingPlayer(
|
||||
// &game->poker.bet, game->poker.players, game->poker.roundSmallBlind
|
||||
// );
|
||||
|
||||
// Restack
|
||||
pokerGameActionRestackAdd(game);
|
||||
// // Restack
|
||||
// pokerGameActionRestackAdd(game);
|
||||
|
||||
// Are we waiting on any players?
|
||||
if(game->poker.bet.better != 0xFF) {
|
||||
pokerGameActionLookAdd(game, game->poker.bet.better);
|
||||
pokerGameActionBetAdd(game);
|
||||
return;
|
||||
}
|
||||
// // Are we waiting on any players?
|
||||
// if(game->poker.bet.better != 0xFF) {
|
||||
// pokerGameActionLookAdd(game, game->poker.bet.better);
|
||||
// pokerGameActionBetAdd(game);
|
||||
// return;
|
||||
// }
|
||||
|
||||
// Not waiting, do next action.
|
||||
pokerGameActionFlopAdd(game);
|
||||
|
@ -18,9 +18,9 @@ void _pokerGameActionFlopOnStart(
|
||||
discussion.poker = game;
|
||||
|
||||
// Get how many players are left in the round.
|
||||
if(pokerPlayerGetCountInRound(game->poker.players) > 1) {// Still more than 1
|
||||
if(pokerInRoundGetCount(game->poker.players) > 1) {// Still more than 1
|
||||
// Add the actual flop action.
|
||||
next = pokerActionNextFlopAdd(queue, &game->poker);
|
||||
// next = pokerActionNextFlopAdd(queue, &game->poker);
|
||||
|
||||
// Reset all the players
|
||||
|
||||
@ -30,23 +30,21 @@ void _pokerGameActionFlopOnStart(
|
||||
discussion.reason = POKER_DISCUSSION_REASON_FLOP;
|
||||
pokerDiscussionQueue(&discussion);
|
||||
|
||||
// Reset the better to the betting round initial.
|
||||
pokerBetResetBetter(
|
||||
&game->poker.bet, game->poker.players, game->poker.roundSmallBlind
|
||||
);
|
||||
// //TODO: Get the next player here.
|
||||
// pokerPlayerGetRemainingBetter(&poker);
|
||||
|
||||
// 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);
|
||||
}
|
||||
// // 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);
|
||||
// }
|
||||
|
||||
// Do next action.
|
||||
queueNext(queue);
|
||||
|
@ -41,9 +41,11 @@ void _pokerGameActionRoundOnEnd(queue_t *queue,queueaction_t *action,uint8_t i){
|
||||
|
||||
// Begin Betting Round. This will queue for one player only and then the round
|
||||
// will take over.
|
||||
pokerBetResetBetter(
|
||||
&game->poker.bet, game->poker.players, game->poker.roundSmallBlind
|
||||
);
|
||||
|
||||
// TODO: finish
|
||||
// pokerBetResetBetter(
|
||||
// &game->poker.bet, game->poker.players, game->poker.roundSmallBlind
|
||||
// );
|
||||
pokerGameActionBetAdd(game);
|
||||
}
|
||||
|
||||
|
@ -17,9 +17,6 @@ void _pokerGameActionStartOnEnd(queue_t *queue,queueaction_t *action,uint8_t i){
|
||||
pokerdiscussiondata_t data;
|
||||
pokergame_t *game = (pokergame_t *)action->data;
|
||||
|
||||
// Begin the match
|
||||
pokerInit(&game->poker);
|
||||
|
||||
// Say that.
|
||||
data.poker = game;
|
||||
data.reason = POKER_DISCUSSION_REASON_MATCH_START;
|
||||
|
@ -14,14 +14,15 @@ void _pokerGameActionWinnerOnStart(
|
||||
pokergame_t *game = (pokergame_t *)action->data;
|
||||
|
||||
// Calculate the winners
|
||||
pokerWinnerCalculate(
|
||||
&game->poker.winner,
|
||||
&game->poker.dealer,
|
||||
game->poker.players
|
||||
);
|
||||
// TODO: Calculate Winners
|
||||
// pokerWinnerCalculate(
|
||||
// &game->poker.winner,
|
||||
// &game->poker.dealer,
|
||||
// game->poker.players
|
||||
// );
|
||||
|
||||
// Action
|
||||
pokerGameWin(&game->poker);
|
||||
// pokerGameWin(&game->poker);
|
||||
|
||||
// Say stuff
|
||||
discussion.reason = POKER_DISCUSSION_REASON_BETTING_DONE;
|
||||
|
Reference in New Issue
Block a user