/// <summary> /// 获得一套随机可用卡牌 /// </summary> public static Stack <String> GetRandomCardStack(int Seed) { Stack <String> Ramdom = new Stack <string>(); try { var cards = new List <String>(); foreach (var CardSN in CardUtility.ReadyCardDic.Keys) { if (CardSN.Substring(1, 1) == "0") { cards.Add(CardSN); } } var newList = CardUtility.RandomSort <String>(cards.ToArray(), Seed); for (int i = 0; i < Math.Min(MaxCards, newList.Length); i++) { Ramdom.Push(newList[i]); } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); } return(Ramdom); }
/// <summary> /// 洗牌 /// </summary> public void Suffle(int Seed) { var newList = CardUtility.RandomSort <String>(CardList.ToArray(), Seed); CardList.Clear(); foreach (var item in newList) { CardList.Push(item); } }