/// <summary> /// Really just clears the used cards so that when GetTopRandomCard /// is called, it has the full deck to look through /// </summary> public void Shuffle() { foreach (Card c in Cards) { c.IsCutCard = false; } DealtCardIndexes.Clear(); }
/// <summary> /// Gets a random card from the deck that hasn't been used /// </summary> /// <returns>Random Card</returns> public Card GetTopRandomCard() { Random rand = new Random(); int index = -1; do { index = rand.Next(Count); } while (DealtCardIndexes.Contains(index)); DealtCardIndexes.Add(index); return(Cards[index]); }