Improved bet tests.

This commit is contained in:
2021-10-14 22:51:47 -07:00
parent 466cb1e2b9
commit 02401337a8
3 changed files with 70 additions and 63 deletions

View File

@ -36,7 +36,7 @@ void pokerBet(
player->currentBet += chips;
pot->chips += chips;
pot->call = mathMax(pot->call, chips);
pot->call = mathMax(pot->call, player->currentBet);
pokerPotAddPlayer(pot, playerIndex);
player->state |= POKER_PLAYER_STATE_HAS_BET_THIS_ROUND;
@ -53,13 +53,14 @@ int32_t pokerBetGetCurrentCallValue(poker_t *poker) {
uint8_t i;
int32_t call;
call = 0;
for(i = 0; i < poker->playerCount; i++) {
call = mathMax(call, poker->players[i].currentBet);
for(i = 0; i < poker->potCount; i++) {
call = mathMax(call, poker->pots[i].call);
}
return call;
}
//eh
int32_t pokerPlayerGetCallBet(poker_t *poker, pokerplayer_t *player) {
return pokerBetGetCurrentCallValue(poker) - player->currentBet;