public static Card[] Shuffle(Card[] cards) { var r = new Random(21452512); var l = cards.Length; for (var i = 0; i < l; i++) { var swap = r.Next(0, l - 1); var c1 = cards[i]; cards[i] = cards[swap]; cards[swap] = c1; //Console.WriteLine(string.Format("Swapped '{0}' with '{1}'", Cards[swap], Cards[i])); } return cards; }
internal static Card[] GetCards() { var cards = new Card[52]; var i = 0; var suits = Suits.GetSuits(); foreach (var suit in suits) { foreach (var rank in RankOrder) { cards[i] = new Card() {Rank = rank, Suit = suit}; i++; } } return cards; }