示例#1
0
        public void Game()
        {
            int rundsTimer = 30;

            while (--rundsTimer > 0)
            {
                board = new List <Card>();
                foreach (Player p in players)
                {
                    if (!p.Fold)
                    {
                        p.SetHand(deck.DrawCard(), deck.DrawCard());
                    }
                }

                int playersfold = 0;
                while (playersfold >= players.Count - 1 || board.Count >= 5)
                {
                    playersfold = 0;
                    foreach (Player p in players)
                    {
                        if (!p.Fold)
                        {
                            p.Act();
                        }
                        else
                        {
                            ++playersfold;
                        }
                    }

                    board.Add(deck.DrawCard());
                }
            }
        }
示例#2
0
 public void GiveEachPlayerCards(int numberOfCards)
 {
     foreach (Player currentPlayer in players)
     {
         for (int i = 0; i < numberOfCards; i++)
         {
             Card temp = deck.DrawCard();
             currentPlayer.GiveCard(temp);
         }
     }
 }
示例#3
0
        static Hand Get5Cards()
        {
            Hand hand = new Hand();

            for (int i = 0; i < 5; i++)
            {
                hand.cards[i] = Deck.DrawCard();
            }
            Console.WriteLine("Confirming, your hand is: " + hand);
            return(hand);
        }