Пример #1
0
        /// <summary>
        ///     Creates a list of active players and grabs the next active player that can act. If play doesn't exist, grab the
        ///     first player in the list
        ///     <returns>next active player</returns>
        /// </summary>
        public PokerPlayer GetNextActivePlayer(PokerPlayer current)
        {
            var index = ActivePlayers.IndexOf(current);

            PokerPlayer activeplayer;

            do
            {
                activeplayer = ActivePlayers[index == -1 ? 0 : (index + 1 >= ActivePlayers.Count ? 0 : (index + 1))];
                index        = ActivePlayers.IndexOf(activeplayer);
            }while (activeplayer.Currency == 0 || activeplayer.HasFolded);

            return(activeplayer == current ? null : activeplayer);
        }