public void Shuffle() { Card[] _cards = new Card[ListCard.Count]; bool[] _index = new bool[ListCard.Count]; int temp = 0; foreach (Card item in ListCard) { while (true) { temp = Rnd.Rand(0, ListCard.Count - 1); if (_index[temp] == false) { break; } } _cards[temp] = item; _index[temp] = true; } ListCard.Clear(); foreach (Card c in _cards) { ListCard.AddLast(c); } }
/// <summary> /// Add Card to Deck's Top (Last of List) /// </summary> /// <param name="_card"></param> public virtual void AddTop(Card _card) { ListCard.AddLast(_card); OnCardAdded(new CardEventArgs(_card)); }