A bit more code cleaning.

This commit is contained in:
2021-07-13 08:59:04 -07:00
parent 5d9c1d6de5
commit d1cbb622f6
11 changed files with 64 additions and 29 deletions

View File

@ -13,4 +13,16 @@ bool pokerPlayerIsAlive(pokerplayer_t *player) {
bool pokerPlayerIsHuman(poker_t *poker, pokerplayer_t *player) {
return (poker->players + POKER_PLAYER_HUMAN_INDEX) == player;
}
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
);
}