/** * Copyright (c) 2021 Dominic Masters * * This software is released under the MIT License. * https://opensource.org/licenses/MIT */ #pragma once #include "../libs.h" #include "../util/array.h" #include "common.h" /** * Adds a new pot to the poker game instance. * * @param poker Poker game instance to add a pot to. * @return The index of the pot within the array of pots. */ uint8_t pokerPotAdd(poker_t *poker); /** * Check whether or not the given player is part of the given pot. * * @param pot Pot to check. * @param playerIndex Player index to see if within the pot or not. * @return True if in the pot, otherwise false. */ bool pokerPotHasPlayer(pokerpot_t *pot, uint8_t playerIndex); /** * Add a player to a pot. This will not let you add the same player to the pot * twice. * * @param pot Pot to add to. * @param playerIndex Players' index to add to the pot. */ void pokerPotAddPlayer(pokerpot_t *pot, uint8_t playerIndex); /** * Returns the sum of chips in the pot(s) that the specified player is in. This * does not consider the pot, player or hand, just the pure sum of chips. * * @param poker Poker game instance. * @param playerIndex Player Index to get the sum of chips from. * @return The sum of chips from the pots the player is within. */ int32_t pokerPotGetSumOfChipsForPlayer(poker_t *poker, uint8_t playerIndex);