Example #1
0
        public IPackOfCards Create()
        {
            PackOfCards newPack = new PackOfCards();
            Card newCard;

            // Clubs
            for (int i = 1; i <= 13; i++)
            {
                newCard = new Card(i, Suit.Clubs);
                newPack.AddCard(newCard);
            }

            // Diamonds
            for (int i = 1; i <= 13; i++)
            {
                newCard = new Card(i, Suit.Diamonds);
                newPack.AddCard(newCard);
            }

            // Hearts
            for (int i = 1; i <= 13; i++)
            {
                newCard = new Card(i, Suit.Hearts);
                newPack.AddCard(newCard);
            }

            // Spades
            for (int i = 1; i <= 13; i++)
            {
                newCard = new Card(i, Suit.Spades);
                newPack.AddCard(newCard);
            }

            return newPack;
        }
Example #2
0
 public void AddCard(Card newCard)
 {
     cards.Add(newCard);
 }