コード例 #1
0
ファイル: Program.cs プロジェクト: gmcdonald73/holdem-bots
        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();
            }
        }