RequestPlayerNameACard() private method

private RequestPlayerNameACard ( GameState gameState ) : Dominion.Card
gameState GameState
return Dominion.Card
コード例 #1
0
ファイル: Guilds.cs プロジェクト: NathanTeeuwen/Dominulator
        public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
        {
            Card cardType = currentPlayer.RequestPlayerNameACard(gameState);
            currentPlayer.RevealCardsFromDeck(3, gameState);

            while (currentPlayer.cardsBeingRevealed.HasCard(cardType))
            {
                currentPlayer.MoveRevealedCardToTrash(cardType, gameState);
            }

            currentPlayer.RequestPlayerPutRevealedCardsBackOnDeck(gameState);
        }
コード例 #2
0
ファイル: Guilds.cs プロジェクト: NathanTeeuwen/Dominulator
        public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
        {
            Card namedCard = currentPlayer.RequestPlayerNameACard(gameState);

            int cardFoundCount = 0;
            while(true)
            {
                Card revealedCard = currentPlayer.DrawAndRevealOneCardFromDeck(gameState);
                if (revealedCard == null)
                    break;
                if (revealedCard == namedCard)
                    continue;
                cardFoundCount++;
                if (cardFoundCount >= 3)
                    break;
            }

            currentPlayer.MoveRevealedCardsToHand(card => card != namedCard);
            currentPlayer.MoveRevealedCardsToDiscard(gameState);
        }
コード例 #3
0
ファイル: DarkAges.cs プロジェクト: peterhal/Dominulator
        public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
        {
            Card cardType = currentPlayer.RequestPlayerNameACard(gameState);

            Card foundCard = null;
            gameState.gameLog.PushScope();
            while (true)
            {
                foundCard = currentPlayer.DrawAndRevealOneCardFromDeck();
                if (foundCard == null)
                    break;

                if (foundCard.isVictory && foundCard != cardType)
                {
                    break;
                }
            }
            currentPlayer.MoveRevealedCardsToDiscard(cardToMove => !cardToMove.Equals(foundCard), gameState);
            gameState.gameLog.PopScope();

            if (foundCard != null)
            {
                int cardCost = foundCard.CurrentCoinCost(currentPlayer);
                currentPlayer.MoveRevealedCardToTrash(foundCard, gameState);
                currentPlayer.RequestPlayerGainCardFromSupply(gameState,
                    acceptableCard => acceptableCard.isVictory && acceptableCard.CurrentCoinCost(currentPlayer) <= cardCost + 3 && acceptableCard.potionCost == foundCard.potionCost,
                    "Gain a victory card costing up to 3 more than the trashed card.");
            }
        }