internal Card RequestPlayerTopDeckCardFromRevealed(GameState gameState, bool isOptional)
{
Card cardTypeToTopDeck = this.actions.GetCardFromRevealedCardsToTopDeck(gameState, isOptional);
if (cardTypeToTopDeck == null && !isOptional)
{
throw new Exception("Must choose a card to top deck");
}
if (cardTypeToTopDeck == null)
{
return null;
}
Card cardToTopDeck = this.cardsBeingRevealed.RemoveCard(cardTypeToTopDeck);
if (cardToTopDeck == null)
{
throw new Exception("Selected a card that wasn't being revealed");
}
this.gameLog.PlayerTopDeckedCard(this, cardToTopDeck);
this.deck.AddCardToTop(cardToTopDeck);
return cardToTopDeck;
}