Esempio n. 1
0
 public void RankHands()
 {
     foreach (var player in ActivePlayers.Where(x => !x.HasFolded))
     {
         player.RankHand(CommunityCards);
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Get the index of the next active player after the given index.
        /// </summary>
        private int NextActivePlayerIndex(int currentIndex, bool informOfTurn = true)
        {
            currentIndex++;
            if (currentIndex >= Players.Count)
            {
                currentIndex = 0;
            }

            int loopCount = 0;

            while (loopCount < 100 && (!Players[currentIndex].Active || Players[currentIndex].Allin))
            {
                currentIndex++;
                if (currentIndex >= Players.Count)
                {
                    currentIndex = 0;
                }
                loopCount++;
            }

            if (informOfTurn && ActivePlayers.Where(x => x.Checked).Count() != ActivePlayers.Length)
            {
                InformOfPlayerTurn(currentIndex);
            }

            return(currentIndex);
        }
Esempio n. 3
0
 public RoboPlayerPlugin FindActivePlugin(RoboPlayer roboplayer)
 {
     return(ActivePlayers.Where(plugin => plugin.Player.Equals(roboplayer)).FirstOrDefault());
 }
Esempio n. 4
0
 internal bool AllCivilliansEliminated()
 {
     return(Mafias.Count >= ActivePlayers.Where(player => player.Role != Role.Mafia).ToList().Count);
 }