예제 #1
0
        private void CalculateNextPlayer()
        {
            do
            {
                currentPlayer = ActiveUnfoldedPlayers.ElementAt((ActiveUnfoldedPlayers.ToList().IndexOf(CurrentPlayer) + 1) % ActiveUnfoldedPlayers.Count);
            }while (CurrentPlayer.CurrentState == Player.State.ActiveAllIn && LastPlayerToRaise != CurrentPlayer);

            CurrentTurn.CurrentPlayer = this.CurrentPlayer;
        }
예제 #2
0
        private void Fold()
        {
            CurrentPlayer.Fold();
            Player playerToRemove = CurrentPlayer;

            //Remover player from all pots
            Pot partialPotIterator = CurrentPot;

            while (partialPotIterator != null)
            {
                partialPotIterator.PlayersClaimPot.Remove(playerToRemove);
                partialPotIterator = partialPotIterator.PartialPot;
            }

            //Remove player from round
            currentPlayer = ActiveUnfoldedPlayers.ElementAt((ActiveUnfoldedPlayers.ToList().IndexOf(CurrentPlayer) - 1) % ActiveUnfoldedPlayers.Count);
            ActiveUnfoldedPlayers.Remove(playerToRemove);
        }