Esempio n. 1
0
        public void DrawOneCard()
        {
            var nextCard = Deck.FirstOrDefault(card => !card.InHand && !card.InDiscard);

            if (nextCard != null)
            {
                nextCard.InHand = true;
            }
            else
            {
                Deck.ForEach(card => card.InDiscard = false);

                var currentDeck = Deck.Where(card => !card.InHand).ToList();
                Shuffle(currentDeck);
                var currentHand = CurrentHand.ToList();

                Deck.Clear();
                Deck.AddRange(currentHand);
                Deck.AddRange(currentDeck);

                DrawOneCard();
            }
        }