예제 #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;
            }
        }