Exemplo n.º 1
0
        public void GetTurnOrder()
        {
            int startIndex = 0;

            SeatsInTurnOrder.Clear();
            foreach (DSeat seat in Seats)
            {
                if (seat.SmallBlind)
                {
                    startIndex = Seats.IndexOf(seat);
                }
            }
            for (int i = 0; i < 6; i++)
            {
                if (startIndex >= 6)
                {
                    startIndex = 0;
                }
                if (Seats[startIndex].Occupied)
                {
                    SeatsInTurnOrder.Add(Seats[startIndex]);
                }
                startIndex++;
            }
        }
Exemplo n.º 2
0
        public Player GetCurrentPlayer()
        {
            Player currentPlayer = Seats[(Seats.IndexOf(PreviousPlayer) + 1) % Seats.Count];

            while (currentPlayer.Folded)
            {
                PreviousPlayer = currentPlayer;
                currentPlayer  = Seats[(Seats.IndexOf(PreviousPlayer) + 1) % Seats.Count];
            }
            return(currentPlayer);
        }