Added basic betting, turns, and added queue restacking
This commit is contained in:
28
src/poker/turn.c
Normal file
28
src/poker/turn.c
Normal 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;
|
||||
}
|
Reference in New Issue
Block a user