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"); } }
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); }