private void TransferMoneyToPot(int playerId, int amount) { var player = _players[playerId]; if (amount > player.StackSize) { throw new Exception("insufficient chips"); } if (amount > 0) { player.StackSize -= amount; var isAllIn = player.StackSize == 0; _potMan.AddPlayersBet(playerId, amount, isAllIn); ReconcileCash(); } }
private void TransferMoneyToPot(int playerNum, int amount) { bool isAllIn; if (amount > _players[playerNum].StackSize) { throw new Exception("insufficient chips"); } if (amount > 0) { _players[playerNum].StackSize -= amount; isAllIn = _players[playerNum].StackSize == 0; _potMan.AddPlayersBet(playerNum, amount, isAllIn); ReconcileCash(); } }