Dawn/src/poker/player.c
2021-09-19 20:50:35 -07:00

23 lines
528 B
C

/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "player.h"
bool pokerPlayerIsAlive(pokerplayer_t *player) {
return !(player->state & (POKER_PLAYER_STATE_FOLDED|POKER_PLAYER_STATE_OUT));
}
void pokerPlayerReset(pokerplayer_t *player) {
player->cardCount = 0;
player->currentBet = 0;
// Invert then bitwise AND to turn off.
player->state &= ~(
POKER_PLAYER_STATE_FOLDED |
POKER_PLAYER_STATE_SHOWING
);
}