Added some basic font rendering and texas holdem
This commit is contained in:
69
include/dawn/cards/poker/holdem.h
Normal file
69
include/dawn/cards/poker/holdem.h
Normal file
@ -0,0 +1,69 @@
|
||||
/**
|
||||
* Copyright (c) 2021 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "../card.h"
|
||||
#include "../../display/spritebatch.h"
|
||||
#include "../../display/texture.h"
|
||||
#include "../../display/tileset.h"
|
||||
|
||||
/** How many cards a player can hold in their hand */
|
||||
#define HOLDEM_PLAYER_HAND 2
|
||||
/** How many cards the dealer can hold in their hand */
|
||||
#define HOLDEM_DEALER_HAND 5
|
||||
/** How many players in a holdem game (excludes dealer) */
|
||||
#define HOLDEM_PLAYER_COUNT 5
|
||||
|
||||
/** State for whether or not a player has folded */
|
||||
#define HOLDEM_STATE_FOLDED 0x01
|
||||
/** State for whether or not a player is showing their hand */
|
||||
#define HOLDEM_STATE_SHOWING 0x02
|
||||
|
||||
/** Texas Hold'em Player State */
|
||||
typedef struct {
|
||||
/** Cards in the players' hand */
|
||||
card_t cards[HOLDEM_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;
|
||||
} holdemplayer_t;
|
||||
|
||||
/** Representation of a Texas Hold'em Game State */
|
||||
typedef struct {
|
||||
/** Current Card Deck */
|
||||
card_t deck[CARD_DECK_SIZE];
|
||||
/** Count of cards in the deck */
|
||||
uint8_t deckSize;
|
||||
|
||||
/** How big is the current small blind */
|
||||
uint32_t blindSmall;
|
||||
/** How big is the current big blind */
|
||||
uint32_t blindBig;
|
||||
/** Current round pot */
|
||||
uint32_t pot;
|
||||
|
||||
/** Cards that have been dealt */
|
||||
card_t cards[HOLDEM_DEALER_HAND];
|
||||
/** How many dealt cards are face up */
|
||||
uint8_t cardsFacing;
|
||||
|
||||
/** Player States */
|
||||
holdemplayer_t players[HOLDEM_PLAYER_COUNT];
|
||||
} holdemgame_t;
|
||||
|
||||
typedef struct {
|
||||
spritebatch_t *batch;
|
||||
texture_t *texture;
|
||||
tileset_t *tileset;
|
||||
} holdemrender_t;
|
Reference in New Issue
Block a user