Пример #1
0
        public void ReturnGetOutOfJailFreeCard(Card card)
        {
            var sCard = (SpecialCard)card;

            if (sCard.CardType == SpecialCardType.GetOutOfJailFreeChance)
            {
                ChanceDeck.Enqueue(card);
            }
            else if (sCard.CardType == SpecialCardType.GetOutOfJailFreeCommunityChest)
            {
                CommunityChestDeck.Enqueue(card);
            }
            else
            {
                throw new ApplicationException("Unknown card return");
            }
        }
Пример #2
0
        public Card GetNextChance()
        {
            var card = ChanceDeck.Dequeue();

            if (card is SpecialCard)
            {
                if (((SpecialCard)card).CardType != SpecialCardType.GetOutOfJailFreeChance)
                {
                    ChanceDeck.Enqueue(card);
                }
            }
            else
            {
                ChanceDeck.Enqueue(card);
            }

            return(card);
        }