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); } }
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); } }
public void Shuffle(Random rand) { RandomExtensions.Shuffle(rand, this.Cards); }
public void RollDie(Random rand) { RandomExtensions.Shuffle(rand, DieSides); }