This commit is contained in:
2022-01-20 15:40:21 -08:00
parent a98bc52be0
commit ef6ab568e8
3 changed files with 38 additions and 15 deletions

View File

@@ -172,25 +172,36 @@ void conversationQueueFlopTurnRiver() {
void conversationQueueWinnerDecide() { void conversationQueueWinnerDecide() {
pokerpot_t *pot; pokerpot_t *pot;
pokerplayerwinning_t winners[POKER_PLAYER_COUNT_MAX]; uint8_t i, countOfPotsWithChips;
uint8_t winnerPlayers[POKER_PLAYER_COUNT_MAX];
uint8_t participants[POKER_PLAYER_COUNT_MAX];
uint8_t winnerCount, participantCount;
QUEUE_ITEM = QUEUE_DEBUG; QUEUE_ITEM = QUEUE_DEBUG;
pot = POKER_POTS + 0; countOfPotsWithChips = 0;
pokerWinnerDetermineForPot( for(i = 0; i < POKER_POT_COUNT; i++) {
pot, pot = POKER_POTS + i;
winners, if(pot->chips == 0) break;
winnerPlayers, countOfPotsWithChips++;
&winnerCount, }
participants,
&participantCount
);
// BGB_printf("Winner count %u", winnerCount); // Message
// BGB_printf("Winner %u", winners[0]); if(countOfPotsWithChips == 1) {
} else {
}
// Pots.
for(i = 0; i < countOfPotsWithChips; i++) {
pot = POKER_POTS + i;
pokerWinnerDetermineForPot(
pot,
POKER_WINNERS,
POKER_WINNER_PLAYERS,
&POKER_WINNER_COUNT,
POKER_WINNER_PARTICIPANTS,
&POKER_WINNER_PARTICIPANT_COUNT
);
// TODO: hand out the winnings.
}
// TODO: Decide on a winner for real. // TODO: Decide on a winner for real.
conversationTextboxString(DEBUG_WINNER_DECIDED); conversationTextboxString(DEBUG_WINNER_DECIDED);

View File

@@ -25,6 +25,12 @@ pokerpot_t POKER_POTS[POKER_POT_COUNT_MAX];
uint8_t POKER_POT_CURRENT; uint8_t POKER_POT_CURRENT;
uint8_t POKER_POT_COUNT; uint8_t POKER_POT_COUNT;
pokerplayerwinning_t POKER_WINNERS[POKER_PLAYER_COUNT_MAX];
uint8_t POKER_WINNER_PLAYERS[POKER_PLAYER_COUNT_MAX];
uint8_t POKER_WINNER_PARTICIPANTS[POKER_PLAYER_COUNT_MAX];
uint8_t POKER_WINNER_COUNT;
uint8_t POKER_WINNER_PARTICIPANT_COUNT;
void pokerInit() { void pokerInit() {
uint8_t i; uint8_t i;

View File

@@ -40,6 +40,12 @@
#define POKER_WINNING_CONFIDENCE_PAIR 200 #define POKER_WINNING_CONFIDENCE_PAIR 200
#define POKER_WINNING_CONFIDENCE_HIGH_CARD 100 #define POKER_WINNING_CONFIDENCE_HIGH_CARD 100
extern pokerplayerwinning_t POKER_WINNERS[POKER_PLAYER_COUNT_MAX];
extern uint8_t POKER_WINNER_PLAYERS[POKER_PLAYER_COUNT_MAX];
extern uint8_t POKER_WINNER_PARTICIPANTS[POKER_PLAYER_COUNT_MAX];
extern uint8_t POKER_WINNER_COUNT;
extern uint8_t POKER_WINNER_PARTICIPANT_COUNT;
/** Holds information about a player's winning state */ /** Holds information about a player's winning state */
typedef struct { typedef struct {
/** The full set of both the dealer and player's hand */ /** The full set of both the dealer and player's hand */