Пример #1
0
        public Deck GetFreshDeck()
        {
            Deck freshDeck = new Deck();
            // nice way to initialize the Deck, using
            // builtin functionality of Enum
            foreach (Suit s in Enum.GetValues(typeof(Suit)))
                foreach (Rank r in Enum.GetValues(typeof(Rank)))
                    if (r != Rank.Unassigned && s != Suit.Unassigned)
                        freshDeck.Add(new Card(r, s));

            return freshDeck;
        }
Пример #2
0
 public void Shuffle(Deck deckToShuffle)
 {
     deck = deckToShuffle;
     this.Shuffle();
 }
Пример #3
0
 public void Shuffle(Deck deckToShuffle, int howManyTimes)
 {
     deck = deckToShuffle;
     this.Shuffle(howManyTimes);
 }
Пример #4
0
 public StandardShuffler(Deck d)
     : this()
 {
     deck = d;
 }