Split the bet tests out.

This commit is contained in:
2021-10-14 22:40:33 -07:00
parent 4d43f837cf
commit 588be5827c
17 changed files with 266 additions and 301 deletions

View File

@ -13,6 +13,7 @@ uint8_t pokerPotAdd(poker_t *poker) {
pot = poker->pots + i;
pot->chips = 0;
pot->playerCount = 0;
pot->call = 0;
return i;
}
@ -26,3 +27,18 @@ void pokerPotAddPlayer(pokerpot_t *pot, uint8_t playerIndex) {
if(pokerPotHasPlayer(pot, playerIndex)) return;
pot->players[pot->playerCount++] = playerIndex;
}
int32_t pokerPotGetSumOfChipsForPlayer(poker_t *poker, uint8_t playerIndex) {
int32_t count;
uint8_t i;
pokerpot_t *pot;
count = 0;
for(i = 0; i < poker->potCount; i++) {
pot = poker->pots + i;
if(!pokerPotHasPlayer(pot, playerIndex)) continue;
count += pot->chips;
}
return count;
}