Dominion.PlayerState.DrawAndLookAtOneCardFromDeck C# (CSharp) Method

DrawAndLookAtOneCardFromDeck() private method

private DrawAndLookAtOneCardFromDeck ( GameState gameState ) : Dominion.Card
gameState GameState
return Dominion.Card
        internal Card DrawAndLookAtOneCardFromDeck(GameState gameState)
        {
            // TODO: separate reveal from look
            return DrawAndRevealOneCardFromDeck(gameState);
        }

Usage Example

Beispiel #1
0
        public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
        {
            currentPlayer.GainCardFromSupply(Silver.card, gameState);

            // look at the top card of the deck and discard or put it back
            Card card = currentPlayer.DrawAndLookAtOneCardFromDeck();
            if (card != null)
            {
                if (currentPlayer.actions.ShouldPlayerDiscardCardFromDeck(gameState, currentPlayer, card))
                {
                    currentPlayer.gameLog.PushScope();
                    currentPlayer.MoveLookedAtCardsToDiscard(gameState);
                    currentPlayer.gameLog.PlayerDiscardCard(currentPlayer, card);
                    currentPlayer.gameLog.PopScope();
                }
                else
                {
                    currentPlayer.MoveLookedAtCardToTopOfDeck(card);
                }
            }

            currentPlayer.DrawUntilCountInHand(5);

            currentPlayer.RequestPlayerTrashCardFromHand(gameState, acceptableCard => !acceptableCard.isTreasure, isOptional: true);
        }
PlayerState