Exemplo n.º 1
0
        public void Discard(Card c)
        {
            discardie.Add(c);
            Console.WriteLine(" ");
            c.Print();
            Console.WriteLine(" ");
            Console.WriteLine("Has been discarded!");
            Console.WriteLine(" ");



            //  string user = "";
            //  Console.Write("What card would you like to discard?: ");

            //  foreach (var i in hand)
            //  {
            //      Console.WriteLine(i);

            //    user = Console.ReadLine();

            //     if (user == i)
            //     {
            //         discardie.Add(user);

            //          hand.Remove(user);
            //     }

            //     else
            //     {
            // Console.WriteLine("There is no such card in your hand!");
            //     }
            // }
        }
Exemplo n.º 2
0
 public void PrintDeckCards()
 {
     for (int i = 0; i < cards.Count; i++)
     {
         Card print_card = cards[i];
         print_card.Print();
     }
 }
Exemplo n.º 3
0
 public void DrawFromTopOfDeck(int cardsToBeDrawn)
 {
     if (cardsToBeDrawn <= cards.Count)
     {
         for (int i = 0; i < cardsToBeDrawn; i++)
         {
             Card chosen_card = cards[0];
             chosen_card.Print();
             cards.RemoveAt(0);
         }
     }
     else
     {
         Console.WriteLine($"Can't take {cardsToBeDrawn} cards, only {cards.Count} cards left..");
     }
 }
Exemplo n.º 4
0
 public void DrawRandomCards(int numberOfCardsToDraw)
 {
     if (numberOfCardsToDraw <= cards.Count)
     {
         for (int i = 0; i < numberOfCardsToDraw; i++)
         {
             int    deck_indexes = (cards.Count - 1);
             Random r            = new Random();
             int    randIndex    = r.Next(0, deck_indexes);
             Card   chosen_card  = cards[randIndex];
             chosen_card.Print();
             cards.RemoveAt(randIndex);
         }
     }
     else
     {
         Console.WriteLine($"Can't take {numberOfCardsToDraw} cards, only {cards.Count} cards left..");
     }
 }