Ejemplo n.º 1
0
        public void PopCards(int amount, string message)
        {
            if (amount > 0) //Pop the appropriate number of cards from the top of the deck
            {
                var sb = new StringBuilder();

                sb.Append("The " + message + " shows: ");

                for (int i = 0; i < amount; ++i)
                {
                    Card popped = Deck.Pop();

                    if (i == 2 || amount == 1)
                    {
                        sb.Append(popped.Name + ".");
                    }
                    else
                    {
                        sb.Append(popped.Name + ", ");
                    }

                    CommunityCards.Add(popped);
                }

                PokerMessage(Dealer, sb.ToString());
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        ///     Deal initial cards to players
        /// </summary>
        public void SetUpHole()
        {
            for (var i = 0; i < 2; ++i)
            //Simulate passing one card out at a time, going around the circle of players 2 times
            {
                foreach (var player in ActivePlayers.ToArray())
                {
                    Card card = Deck.Pop();
                    player.AddCard(card);
                }
            }

            //if >3 players, smallblind posts smallblind else dealerbutton does
            DoAction(BigBlind != null ? SmallBlind : DealerButton, PlayerAction.Bet, Dealer.SmallBlind, true, false);

            //if >3 players, bigblind posts bigblind else smallblind does
            DoAction(BigBlind ?? SmallBlind, PlayerAction.Bet, Dealer.BigBlind, true, false);

            CurrentTurn = BigBlind ?? SmallBlind;

            AssignNextTurn();
        }