Example #1
0
 public Deck PullOutValues(Values value)
 {
     Deck deckToReturn = new Deck(new Card[] { });
     for (int i = cards.Count - 1; i >= 0; i--)
         if (cards[i].Value == value)
             deckToReturn.Add(Deal(i));
     return deckToReturn;
 }
Example #2
0
 private void DealCards(Deck deckToDeal, string title)
 {
     Console.WriteLine(title);
     while (deckToDeal.Count > 0)
     {
         Card nextCard = deckToDeal.Deal(0);
         Console.WriteLine(nextCard.Name);
     }
     Console.WriteLine("------------------");
 }
Example #3
0
 private Deck RandomDeck(int number)
 {
     Deck myDeck = new Deck(new Card[] { });
     for (int i = 0; i < number; i++)
     {
         myDeck.Add(new Card(
             (Suits)random.Next(4),
             (Values)random.Next(1, 14)));
     }
     return myDeck;
 }