Dominion.PlayerState.RequestPlayerDiscardRevealedCard C# (CSharp) Method

RequestPlayerDiscardRevealedCard() private method

private RequestPlayerDiscardRevealedCard ( GameState gameState ) : void
gameState GameState
return void
        internal void RequestPlayerDiscardRevealedCard(GameState gameState)
        {
            if (this.cardsBeingRevealed.Any)
            {
                Card cardToDiscard = this.actions.GetCardFromRevealedCardsToDiscard(gameState);
                if (cardToDiscard == null)
                {
                    throw new Exception("Player must choose a card to trash");
                }

                this.MoveRevealedCardToDiscard(cardToDiscard, gameState);
            }
        }

Usage Example

Beispiel #1
0
        public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
        {
            currentPlayer.RevealCardsFromDeck(1);
            Card revealedCard  = currentPlayer.CardsBeingRevealed.First();

            currentPlayer.RequestPlayerDiscardRevealedCard(gameState);
            currentPlayer.MoveRevealedCardToTopOfDeck();

            if (revealedCard.isAction)
            {
                currentPlayer.AddActions(1);
            }

            if (revealedCard.isTreasure)
            {
                currentPlayer.AddCoins(1);
            }

            if (revealedCard.isVictory)
            {
                currentPlayer.DrawOneCardIntoHand();
            }
        }
All Usage Examples Of Dominion.PlayerState::RequestPlayerDiscardRevealedCard
PlayerState