RevealCardsFromDiscard() private method

private RevealCardsFromDiscard ( int cardCount, CardPredicate cardPredicate ) : void
cardCount int
cardPredicate CardPredicate
return void
Ejemplo n.º 1
0
        public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
        {
            int maxCoppers = currentPlayer.discard.CountWhere(card => card == Cards.Copper);
            int cardsToPutInHand = currentPlayer.actions.GetNumberOfCoppersToPutInHandForCountingHouse(gameState, maxCoppers);

            if (cardsToPutInHand < 0 || cardsToPutInHand > maxCoppers)
            {
                throw new Exception("Requested number of cards to reveal is out of range");
            }

            if (cardsToPutInHand > 0)
            {
                currentPlayer.RevealCardsFromDiscard(cardsToPutInHand, card => card == Cards.Copper);
                currentPlayer.MoveAllRevealedCardsToHand();
            }
        }