Dominion.PlayerState.TrashCardFromTopOfDeck C# (CSharp) Method

TrashCardFromTopOfDeck() private method

private TrashCardFromTopOfDeck ( GameState gameState ) : Dominion.Card
gameState GameState
return Dominion.Card
        internal Card TrashCardFromTopOfDeck(GameState gameState)
        {
            Card card = DrawOneCard(gameState);
            if (card == null)
            {
                return null;
            }

            MoveCardToTrash(card, gameState);

            return card;
        }

Usage Example

Ejemplo n.º 1
0
 public override void DoSpecializedAttack(PlayerState currentPlayer, PlayerState otherPlayer, GameState gameState)
 {
     // Each other player trashes the top card of his deck ...
     Card trashedCard = otherPlayer.TrashCardFromTopOfDeck(gameState);
     if (trashedCard != null)
     {
         // ... and gains a card with the same cost that you choose
         currentPlayer.RequestPlayerGainCardFromSupply(
             gameState,
             otherPlayer,
             acceptableCard => acceptableCard.CurrentCoinCost(currentPlayer) == trashedCard.CurrentCoinCost(currentPlayer) && acceptableCard.potionCost == trashedCard.potionCost,
             "Card costing equal trashed card");
     }
 }
PlayerState