Dynamic_Games.IncInformation.Game.Deal.pay C# (CSharp) Метод

pay() публичный Метод

public pay ( ) : void
Результат void
        public void pay()
        {
            int maxid = 300; // remains 0
            uint maxvalue = 0;
            uint tmpval;
            foreach (Player.Player p in table.players)
            {
                //determine winner transfer players.bet to winner
                if (!p.folded)
                {
                    tmpval = table.getHand(p.id).HandValue;

                    if (tmpval > maxvalue)
                    {
                        maxvalue = tmpval;
                        maxid = p.id;
                    }
                }
            }
            payPlayer(maxid);
            if (wasAllIn())
                pay();
        }

Usage Example

        public void playTable()
        {
            int rounds = 0;

            foreach (Player.Player p in players)
            {
                p.bet = 0;
            }
            while (deal.markedForRemove.Count < players.Count - 1)
            {
                deal.play();
                //  MessageBox.Show("Kor vege!\n " + getHandValue(0) +"\n"+ getHandValue(1));
                deal.pay();
                removePlayers();
                nextState();
                resetFolds();
                movePos();
                rounds++;
                if (rounds == 5)
                {
                    rounds     = 0;
                    smallBlind = bigBlind;
                    bigBlind  *= 2;
                }
                controls.vizualize();
            }
            int tmpid = nextActiveId(0) + 1;

            MessageBox.Show("Winner is Player " + tmpid);
            controls.Invoke((Action) delegate
            {
                controls.newTable();
            });
        }