コード例 #1
0
 public void ValidateDeck(Random rand)
 {
     while (restrictedCards.Contains(deck.Cards[0].Value) || restrictedCards.Contains(deck.Cards[1].Value) || restrictedCards.Contains(deck.Cards[deck.Cards.Count - 1].Value) || restrictedCards.Contains(deck.Cards[deck.Cards.Count - 2].Value))
     {
         RandomExtensions.Shuffle(rand, deck.Cards);
     }
 }
コード例 #2
0
 public void ValidateDeck(Random rand)
 {
     // A valid deck should not have J, Q, K, A , 2 & Joker as its first 3 and last 3 cards.
     while (restrictedCards.Contains(deck.Cards[0].Value) || restrictedCards.Contains(deck.Cards[1].Value) || restrictedCards.Contains(deck.Cards[2].Value) || restrictedCards.Contains(deck.Cards[deck.Cards.Count - 1].Value) || restrictedCards.Contains(deck.Cards[deck.Cards.Count - 2].Value) || restrictedCards.Contains(deck.Cards[deck.Cards.Count - 3].Value))
     {
         RandomExtensions.Shuffle(rand, deck.Cards);
     }
 }
コード例 #3
0
 public void Shuffle(Random rand)
 {
     RandomExtensions.Shuffle(rand, this.Cards);
 }
コード例 #4
0
 public void RollDie(Random rand)
 {
     RandomExtensions.Shuffle(rand, DieSides);
 }