Winner logic finished.
This commit is contained in:
@ -58,6 +58,7 @@
|
||||
#define POKER_RIVER_CARD_COUNT 1
|
||||
|
||||
/** Winning Types */
|
||||
#define POKER_WINNING_TYPE_NULL 0x00
|
||||
#define POKER_WINNING_TYPE_ROYAL_FLUSH 0x01
|
||||
#define POKER_WINNING_TYPE_STRAIGHT_FLUSH 0x02
|
||||
#define POKER_WINNING_TYPE_FOUR_OF_A_KIND 0x03
|
||||
@ -72,6 +73,22 @@
|
||||
/** How many cards make a winning set */
|
||||
#define POKER_WINNING_SET_SIZE 5
|
||||
|
||||
/** Holds information about the winning player state */
|
||||
typedef struct {
|
||||
/** The full set of both the dealer and player's hand */
|
||||
card_t full[POKER_PLAYER_HAND + POKER_DEALER_HAND];
|
||||
uint8_t fullSize;
|
||||
|
||||
/** Holds the winning set */
|
||||
card_t set[POKER_WINNING_SET_SIZE];
|
||||
uint8_t setSize;
|
||||
|
||||
/** Winning Type */
|
||||
uint8_t type;
|
||||
|
||||
/** If there was a kicker card it will be here, otherwise -1 for no kicker */
|
||||
card_t kicker;
|
||||
} pokerwinning_t;
|
||||
|
||||
typedef struct {
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
@ -96,6 +113,11 @@ typedef struct {
|
||||
/** Player States */
|
||||
pokerplayer_t players[POKER_PLAYER_COUNT];
|
||||
|
||||
/** Winning States */
|
||||
pokerwinning_t winnings[POKER_PLAYER_COUNT];
|
||||
uint8_t winners[POKER_PLAYER_COUNT];
|
||||
uint8_t winnerCount;
|
||||
|
||||
/** The current round the game is on */
|
||||
uint8_t round;
|
||||
|
||||
@ -153,18 +175,4 @@ typedef struct {
|
||||
texture_t cardTexture;
|
||||
tileset_t cardTileset;
|
||||
primitive_t cardPrimitive;
|
||||
} poker_t;
|
||||
|
||||
/** Holds information about the winning player state */
|
||||
typedef struct {
|
||||
/** The full set of both the dealer and player's hand */
|
||||
card_t full[POKER_PLAYER_HAND + POKER_DEALER_HAND];
|
||||
uint8_t size;
|
||||
|
||||
/** Holds the winning set */
|
||||
int32_t set[POKER_WINNING_SET_SIZE];
|
||||
uint8_t count;
|
||||
|
||||
/** Winning Type */
|
||||
uint8_t type;
|
||||
} pokerwinning_t;
|
||||
} poker_t;
|
Reference in New Issue
Block a user