示例#1
0
文件: Deck.cs 项目: HanNguyen-dev/P2
        public DCard Draw()
        {
            DCard draw = Cards[0];

            Cards.RemoveAt(0);
            return(draw);
        }
示例#2
0
文件: Deck.cs 项目: HanNguyen-dev/P2
        public void Shuffle()
        {
            Random rng   = new Random();
            int    count = Cards.Count;

            while (count > 1)
            {
                count--;
                int   rand = rng.Next(count + 1);
                DCard card = Cards[rand];
                Cards[rand]  = Cards[count];
                Cards[count] = card;
            }
        }