public Object Clone() { Cards newCards = new Cards(); foreach (Card sourceCard in List) { newCards.Add(sourceCard.Clone() as Card); } return newCards; }
public void Shuffle() { //Card[] newDeck = new Card[52]; Cards newDeck = new Cards(); bool[] assigned = new bool[52]; Random sourceGen = new Random(); for(int i = 0; i < 52; i++) { int sourceCard = 0; bool foundCard = false; while (foundCard == false) { sourceCard = sourceGen.Next(52); if (assigned[sourceCard] == false) foundCard = true; } assigned[sourceCard] = true; //newDeck[sourceCard] = cards[i]; newDeck.Add(cards[sourceCard]); } newDeck.CopyTo(cards); }