Made betting work correctly.
This commit is contained in:
@ -72,6 +72,7 @@
|
||||
|
||||
// Utility Objects
|
||||
#include "util/array.h"
|
||||
#include "util/flags.h"
|
||||
#include "util/list.h"
|
||||
#include "util/math.h"
|
||||
#include "util/rand.h"
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
#pragma once
|
||||
#include "../libs.h"
|
||||
#include "player.h"
|
||||
|
||||
/** How many chips each player has by defautl */
|
||||
#define POKER_BET_PLAYER_CHIPS_DEFAULT 10000
|
||||
@ -17,6 +18,16 @@
|
||||
/** The default blind cost for the small blind. (Defaults half big blind) */
|
||||
#define POKER_BET_BLIND_SMALL_DEFAULT (POKER_BET_BLIND_BIG_DEFAULT/2)
|
||||
|
||||
/**
|
||||
* The default betting player for the round.
|
||||
*
|
||||
* @param poker Pointer to the poker instance.
|
||||
* @return The Poker round default betting player.
|
||||
*/
|
||||
#define POKER_BET_ROUND_PLAYER_DEFAULT(poker) ( \
|
||||
((poker)->roundSmallBlind + 1) % POKER_PLAYER_COUNT \
|
||||
)
|
||||
|
||||
typedef struct {
|
||||
/** Blinds */
|
||||
int32_t blindSmall, blindBig;
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
#pragma once
|
||||
#include "../libs.h"
|
||||
#include "../util/flags.h"
|
||||
#include "bet.h"
|
||||
#include "card.h"
|
||||
|
||||
@ -21,18 +22,20 @@
|
||||
// Player States
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/** State for whether or not a player has folded */
|
||||
#define POKER_PLAYER_STATE_FOLDED 0x01
|
||||
#define POKER_PLAYER_STATE_FOLDED flagDefine(0)
|
||||
|
||||
/** State for whether or not a player is showing their hand */
|
||||
#define POKER_PLAYER_STATE_SHOWING 0x02
|
||||
#define POKER_PLAYER_STATE_SHOWING flagDefine(1)
|
||||
|
||||
/** State for whether or not the player is out */
|
||||
#define POKER_PLAYER_STATE_OUT 0x04
|
||||
#define POKER_PLAYER_STATE_OUT flagDefine(2)
|
||||
|
||||
/** Flag that is reset at the start of each round, and set when move occurs. */
|
||||
#define POKER_PLAYER_STATE_ROUND_MOVE flagDefine(3)
|
||||
|
||||
/** The index that the player who is the human... is */
|
||||
#define POKER_PLAYER_HUMAN_INDEX 0x02
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Player Definition
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
26
include/dawn/util/flags.h
Normal file
26
include/dawn/util/flags.h
Normal file
@ -0,0 +1,26 @@
|
||||
/**
|
||||
* Copyright (c) 2021 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "../libs.h"
|
||||
|
||||
/**
|
||||
* Create a flag definition.
|
||||
*
|
||||
* @param n The flag number.
|
||||
* @return The bitwise flag for that number.
|
||||
*/
|
||||
#define flagDefine(n) (1 << n)
|
||||
|
||||
/**
|
||||
* Turns a flag off in a state.
|
||||
*
|
||||
* @param state State to update.
|
||||
* @param flag Flag to turn off.
|
||||
* @return The updated state.
|
||||
*/
|
||||
#define flagOff(state, flag) (state & ~flag)
|
@ -10,13 +10,14 @@
|
||||
#include "../display/animation/timeline.h"
|
||||
#include "../display/gui/font.h"
|
||||
#include "../ui/frame.h"
|
||||
#include "../util/flags.h"
|
||||
|
||||
/** Amount of characters scrolled, per second */
|
||||
#define VN_TEXTBOX_SCROLL_SPEED 60
|
||||
|
||||
#define VN_TEXTBOX_FONT_SIZE 16.0
|
||||
|
||||
#define VN_TEXTBOX_STATE_CLOSED 0x01
|
||||
#define VN_TEXTBOX_STATE_CLOSED flagDefine(0)
|
||||
|
||||
typedef struct {
|
||||
/** Stores the maximum width that this textbox can take up */
|
||||
|
Reference in New Issue
Block a user