Added basic betting, turns, and added queue restacking

This commit is contained in:
2021-08-13 09:32:15 -07:00
parent 42de949822
commit e66610b933
14 changed files with 217 additions and 8 deletions

28
src/poker/turn.c Normal file
View File

@@ -0,0 +1,28 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "turn.h"
pokerturn_t pokerTurnGet(poker_t *poker, uint8_t playerIndex) {
pokerturn_t turn;
pokerplayer_t *player;
player = poker->players + playerIndex;
// Can the player do anything?
turn.type = POKER_TURN_TYPE_OUT;
if(player->state & POKER_PLAYER_STATE_FOLDED) return turn;
if(player->state & POKER_PLAYER_STATE_OUT) return turn;
// I have nfi
turn.type = POKER_TURN_TYPE_BET;
turn.chips = 1;
turn.confidence = 1;
return turn;
}