Пример #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 GetNextCommunityChest()
        {
            var card = CommunityChestDeck.Dequeue();

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

            return(card);
        }