public SuperDeck()
        {
            Cards = new List <GenericCard>();

            var animalDeck      = new AnimalDeck();
            var playingCardDeck = new PlayingCardDeck();

            foreach (var animalCard in animalDeck)
            {
                Cards.Add(animalCard);
            }

            foreach (var playingCard in playingCardDeck)
            {
                Cards.Add(playingCard);
            }
        }
Example #2
0
        public SuperDeck()
        {
            Cards = new List <Card>();

            // This leverages the public card on Deck, a little naughty but hey ho
            //var animalDeck = new AnimalDeck();
            //var playingCardDeck = new PlayingCardDeck();

            //Cards = animalDeck.Cards;
            //Cards.AddRange(playingCardDeck.Cards);

            // This is a messy way of accessing the lengths on the deck. Would prefer to enumerate over

            /*for (int i = 0; i < animalDeck.GetCards().Length; i++)
             * {
             *  var dealtAnimalCard = animalDeck.Deal();
             *  Cards.Add(dealtAnimalCard);
             * }
             *
             * for (int i = 0; i < playingCardDeck.GetCards().Length; i++)
             * {
             *  var dealtPlayingCard = playingCardDeck.Deal();
             *  Cards.Add(dealtPlayingCard);
             * }*/

            // Uses the enumerable interface on the deck
            var animalDeck      = new AnimalDeck();
            var playingCardDeck = new PlayingCardDeck();

            foreach (var playingCard in playingCardDeck)
            {
                Cards.Add(playingCard);
            }

            foreach (var animalCard in animalDeck)
            {
                Cards.Add(animalCard);
            }
        }
 public Snap(AnimalDeck deck)
 {
     this._deck = deck;
     this._deck.Shuffle();
 }
Example #4
0
 public Snap(AnimalDeck deck)
 {
     _deck = deck;
     _deck.Shuffle();
 }