Working
This commit is contained in:
		@@ -172,25 +172,36 @@ void conversationQueueFlopTurnRiver() {
 | 
			
		||||
 | 
			
		||||
void conversationQueueWinnerDecide() {
 | 
			
		||||
  pokerpot_t *pot;
 | 
			
		||||
  pokerplayerwinning_t winners[POKER_PLAYER_COUNT_MAX];
 | 
			
		||||
  uint8_t winnerPlayers[POKER_PLAYER_COUNT_MAX];
 | 
			
		||||
  uint8_t participants[POKER_PLAYER_COUNT_MAX];
 | 
			
		||||
  uint8_t winnerCount, participantCount;
 | 
			
		||||
  uint8_t i, countOfPotsWithChips;
 | 
			
		||||
 | 
			
		||||
  QUEUE_ITEM = QUEUE_DEBUG;
 | 
			
		||||
 | 
			
		||||
  pot = POKER_POTS + 0;
 | 
			
		||||
  pokerWinnerDetermineForPot(
 | 
			
		||||
    pot,
 | 
			
		||||
    winners,
 | 
			
		||||
    winnerPlayers,
 | 
			
		||||
    &winnerCount,
 | 
			
		||||
    participants,
 | 
			
		||||
    &participantCount
 | 
			
		||||
  );
 | 
			
		||||
  countOfPotsWithChips = 0;
 | 
			
		||||
  for(i = 0; i < POKER_POT_COUNT; i++) {
 | 
			
		||||
    pot = POKER_POTS + i;
 | 
			
		||||
    if(pot->chips == 0) break;
 | 
			
		||||
    countOfPotsWithChips++;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // BGB_printf("Winner count %u", winnerCount);
 | 
			
		||||
  // BGB_printf("Winner %u", winners[0]);
 | 
			
		||||
  // Message
 | 
			
		||||
  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.
 | 
			
		||||
  conversationTextboxString(DEBUG_WINNER_DECIDED);
 | 
			
		||||
 
 | 
			
		||||
@@ -25,6 +25,12 @@ pokerpot_t POKER_POTS[POKER_POT_COUNT_MAX];
 | 
			
		||||
uint8_t POKER_POT_CURRENT;
 | 
			
		||||
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() {
 | 
			
		||||
  uint8_t i;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -40,6 +40,12 @@
 | 
			
		||||
#define POKER_WINNING_CONFIDENCE_PAIR 200
 | 
			
		||||
#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 */
 | 
			
		||||
typedef struct {
 | 
			
		||||
  /** The full set of both the dealer and player's hand */
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user