public void ShuffleDeck() { Card tempCard = new Card(1, 1, 's'); Random rnd = new Random(); for (int i = 0; i < sizeOfDeck; i++) { int rndCardNo = rnd.Next(sizeOfDeck); tempCard.SetId(deck[rndCardNo].GetId()); tempCard.SetValue(deck[rndCardNo].GetValue()); tempCard.SetSuit(deck[rndCardNo].GetSuit()); deck[rndCardNo].SetId(deck[i].GetId()); deck[rndCardNo].SetValue(deck[i].GetValue()); deck[rndCardNo].SetSuit(deck[i].GetSuit()); deck[i].SetId(tempCard.GetId()); deck[i].SetValue(tempCard.GetValue()); deck[i].SetSuit(tempCard.GetSuit()); } }