예제 #1
0
        private Queue <SheepCard> ShuffleCards()
        {
            List <SheepCard> cards = CardUtil.UnshuffledList();

            for (var i = Game.CARDS_IN_DECK - 1; i > 0; --i)
            {
                var j    = _random.Next(i);
                var swap = cards[i];
                cards[i] = cards[j];
                cards[j] = swap;
            }
            var queue = new Queue <SheepCard>();

            cards.ForEach(c => queue.Enqueue(c));
            return(queue);
        }