Exemplo n.º 1
0
        public void draw()
        {
            // Positions in table
            buttonPosition = players.Last();
            if (players.Count == 4)
            {
                bigBlindPosition   = players.ElementAt(1);
                smallBlindPosition = players.First();
                startPosition      = players.ElementAt(2);

                inPlay.Add(startPosition);
                inPlay.Add(buttonPosition);
                inPlay.Add(smallBlindPosition);
                inPlay.Add(bigBlindPosition);
            }
            else if (players.Count == 3)
            {
                bigBlindPosition   = players.ElementAt(1);
                smallBlindPosition = players.First();
                startPosition      = buttonPosition;

                inPlay.Add(startPosition);
                inPlay.Add(smallBlindPosition);
                inPlay.Add(bigBlindPosition);
            }
            else
            {
                smallBlindPosition = players.First();
                startPosition      = smallBlindPosition;
                bigBlindPosition   = buttonPosition;

                inPlay.Add(startPosition);
                inPlay.Add(buttonPosition);
            }

            // See who is still playing
            numberOfBets = players.Count - inPlay.Count;

            // Get the playing cards
            List <Card> play = cards.getPlay(players.Count);

            // Players Hands
            playersHands.Add(new List <Card>());
            playersHands.Add(new List <Card>());
            playersHands.Add(new List <Card>());
            playersHands.Add(new List <Card>());

            bets.Add(0);
            bets.Add(0);
            bets.Add(0);
            bets.Add(0);

            for (int i = 0; i < 2; i++)
            {
                for (int j = 0; j < players.Count; j++)
                {
                    playersHands.ElementAt(players[j] - 1).Add(play.First());
                    play.RemoveAt(0);
                }
            }

            Console.WriteLine();

            // Flop
            play.RemoveAt(0);
            for (int j = 0; j < 3; j++)
            {
                remainingTurnsCards.Add(play.First());
                play.RemoveAt(0);
            }

            // Turn and river
            for (int j = 0; j < 2; j++)
            {
                play.RemoveAt(0);
                remainingTurnsCards.Add(play.First());
                play.RemoveAt(0);
            }
        }