/** * Copyright (c) 2021 Dominic Masters * * This software is released under the MIT License. * https://opensource.org/licenses/MIT */ #pragma once #include "../libs.h" /** How many cards the dealer can hold in their hand */ #define HOLDEM_DEALER_HAND 5 /** How many cards a player can hold in their hand */ #define POKER_PLAYER_HAND 2 /** How many players in a poker game (excludes dealer) */ #define POKER_PLAYER_COUNT 5 /** State for whether or not a player has folded */ #define POKER_PLAYER_STATE_FOLDED 0x01 /** State for whether or not a player is showing their hand */ #define POKER_PLAYER_STATE_SHOWING 0x02 /** Various seats at the table that people can sit */ #define HOLDEM_GAME_SEAT_DEALER 0x00 #define HOLDEM_GAME_SEAT_PLAYER0 0x04 #define HOLDEM_GAME_SEAT_PLAYER1 0x06 #define HOLDEM_GAME_SEAT_PLAYER2 0x05 #define HOLDEM_GAME_SEAT_PLAYER3 0x03 #define HOLDEM_GAME_SEAT_PLAYER4 0x02 /** Poker Player State */ typedef struct { /** Cards in the players' hand */ card_t cards[POKER_PLAYER_HAND]; uint8_t cardCount; /** Current State of player */ uint8_t state; /** Chips in players' posession */ uint32_t chips; /** Current bet in current round player has placed */ uint32_t currentBet; } pokerplayer_t;