Пример #1
0
        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();
            }
        }
Пример #2
0
        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();
            }
        }