public void RankHands() { foreach (var player in ActivePlayers.Where(x => !x.HasFolded)) { player.RankHand(CommunityCards); } }
/// <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); }
public RoboPlayerPlugin FindActivePlugin(RoboPlayer roboplayer) { return(ActivePlayers.Where(plugin => plugin.Player.Equals(roboplayer)).FirstOrDefault()); }
internal bool AllCivilliansEliminated() { return(Mafias.Count >= ActivePlayers.Where(player => player.Role != Role.Mafia).ToList().Count); }