Exemplo n.º 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;
        }
Exemplo n.º 2
0
 public void Shuffle(Deck deckToShuffle)
 {
     deck = deckToShuffle;
     this.Shuffle();
 }
Exemplo n.º 3
0
 public void Shuffle(Deck deckToShuffle, int howManyTimes)
 {
     deck = deckToShuffle;
     this.Shuffle(howManyTimes);
 }
Exemplo n.º 4
0
 public StandardShuffler(Deck d)
     : this()
 {
     deck = d;
 }