当前位置: 首页>>代码示例>>C#>>正文


C# PlayerState.RequestPlayerTrashCardFromHand方法代码示例

本文整理汇总了C#中Dominion.PlayerState.RequestPlayerTrashCardFromHand方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerState.RequestPlayerTrashCardFromHand方法的具体用法?C# PlayerState.RequestPlayerTrashCardFromHand怎么用?C# PlayerState.RequestPlayerTrashCardFromHand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Dominion.PlayerState的用法示例。


在下文中一共展示了PlayerState.RequestPlayerTrashCardFromHand方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DoSpecializedAction

        public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
        {
            currentPlayer.victoryTokenCount += 1;
            Card trashedCard = currentPlayer.RequestPlayerTrashCardFromHand(gameState, acceptableCardsToTrash => true, isOptional: false);
            if (trashedCard != null)
            {
                currentPlayer.victoryTokenCount += trashedCard.CurrentCoinCost(currentPlayer) / 2;
            }

            foreach (PlayerState otherPlayer in gameState.players.OtherPlayers)
            {
                otherPlayer.RequestPlayerTrashCardFromHand(gameState, acceptableCardsToTrash => true, isOptional: true);
            }
        }
开发者ID:peterhal,项目名称:Dominulator,代码行数:14,代码来源:Prosperity.cs

示例2: DoSpecializedAction

        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);
        }
开发者ID:peterhal,项目名称:Dominulator,代码行数:25,代码来源:Hinterlands.cs

示例3: DoSpecializedAction

        public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
        {
            currentPlayer.AddCoinTokens(2);

            int coinCount = currentPlayer.actions.GetCoinAmountToUseInButcher(gameState);
            if (coinCount > currentPlayer.AvailableCoinTokens)
                throw new Exception("Tried to use too many coins");

            Card trashedCard = currentPlayer.RequestPlayerTrashCardFromHand(gameState, card => true, isOptional: true);
            if (trashedCard == null)
                return;

            currentPlayer.AddCoinTokens(-coinCount);

            currentPlayer.RequestPlayerGainCardFromSupply(
                gameState,
                card => card.CurrentCoinCost(currentPlayer) == trashedCard.CurrentCoinCost(currentPlayer) + coinCount &&
                        card.potionCost == trashedCard.potionCost,
                "Must gain a card costing exactly equal to the cost of the card trashed plus any coin spent");
        }
开发者ID:NathanTeeuwen,项目名称:Dominulator,代码行数:20,代码来源:Guilds.cs

示例4: DoSpecializedAction

        public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
        {
            Card trashedCard = currentPlayer.RequestPlayerTrashCardFromHand(gameState, card => true, false);

            int trashedCardCost = trashedCard.CurrentCoinCost(currentPlayer);

            CardPredicate validCard = card => (card.CurrentCoinCost(currentPlayer) == (trashedCardCost - 1)
                ^ card.CurrentCoinCost(currentPlayer) == (trashedCardCost + 1)) && card.potionCost == trashedCard.potionCost;

            Card gainedCard = currentPlayer.RequestPlayerGainCardFromSupply(gameState, validCard, "Must gain a card costing one less or one more than the trashed card.", isOptional: false, defaultLocation: DeckPlacement.TopOfDeck);
            if (gainedCard != null)
            {
                validCard = card => card.CurrentCoinCost(currentPlayer) == 2 * trashedCardCost - gainedCard.CurrentCoinCost(currentPlayer)
                    && card.potionCost == trashedCard.potionCost;

                currentPlayer.RequestPlayerGainCardFromSupply(gameState, validCard, "Must gain a card with the right cost.", isOptional: false, defaultLocation: DeckPlacement.TopOfDeck);
            }
        }
开发者ID:NathanTeeuwen,项目名称:Dominulator,代码行数:18,代码来源:Hinterlands.cs

示例5: DoSpecializedAction

 public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
 {
     Card card = currentPlayer.RequestPlayerTrashCardFromHand(gameState, acceptableCard => true, isOptional: false);
     if (card != null)
     {
         currentPlayer.AddCoins(card.CurrentCoinCost(currentPlayer));
     }
 }
开发者ID:peterhal,项目名称:Dominulator,代码行数:8,代码来源:Seaside.cs

示例6: DoSpecializedAction

        public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
        {
            Card trashedCard = currentPlayer.RequestPlayerTrashCardFromHand(gameState, acceptableCard => true, isOptional: false);

            if (trashedCard.isAction)
                currentPlayer.GainCardFromSupply(Duchy.card, gameState);

            if (trashedCard.isTreasure)
                currentPlayer.GainCardFromSupply(Transmute.card, gameState);

            if (trashedCard.isVictory)
                currentPlayer.GainCardFromSupply(Gold.card, gameState);
        }
开发者ID:NathanTeeuwen,项目名称:Dominulator,代码行数:13,代码来源:Alchemy.cs

示例7: DoSpecializedAction

 public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
 {
     currentPlayer.RequestPlayerTrashCardFromHand(gameState, card => true, isOptional: false);
 }
开发者ID:peterhal,项目名称:Dominulator,代码行数:4,代码来源:DarkAges.cs

示例8: DoSpecializedActionOnBuyWhileInHand

        private new DeckPlacement DoSpecializedActionOnBuyWhileInHand(PlayerState currentPlayer, GameState gameState, Card gainedCard)
        {
            if (gainedCard.isVictory)
            {
                currentPlayer.RequestPlayerTrashCardFromHand(gameState, card => card == Hovel.card, isOptional: true);
            }

            return DeckPlacement.Default;
        }
开发者ID:peterhal,项目名称:Dominulator,代码行数:9,代码来源:DarkAges.cs

示例9: DoSpecializedAction

        public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
        {
            int additionalCoins = gameState.supplyPiles.Where(pile => pile.ProtoTypeCard.isVictory && gameState.HasCardEverBeenGainedFromPile(pile)).Count();
            currentPlayer.AddCoins(additionalCoins);

            currentPlayer.RequestPlayerTrashCardFromHand(gameState, card => true, isOptional: false);
        }
开发者ID:NathanTeeuwen,项目名称:Dominulator,代码行数:7,代码来源:Prosperity.cs

示例10: DoSpecializedAction

        public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
        {
            foreach (PlayerState player in gameState.players.AllPlayers)
            {
                player.cardToPass.Set(player.RequestPlayerGiveCardToPassLeft(gameState));
            }

            for (int playerIndex = 0; playerIndex < gameState.players.PlayerCount; ++playerIndex)
            {
                Card card = gameState.players[playerIndex].cardToPass.Card;
                if (card != null)
                {
                    gameState.players[playerIndex + 1].hand.AddCard(card);
                }
            }

            foreach (PlayerState player in gameState.players.AllPlayers)
            {
                player.cardToPass.Clear();
            }

            currentPlayer.RequestPlayerTrashCardFromHand(gameState, acceptableCard => true, isOptional: true);
        }
开发者ID:peterhal,项目名称:Dominulator,代码行数:23,代码来源:Intrigue.cs

示例11: DoSpecializedAction

        public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
        {
            Card trashedCard = null;
            if (currentPlayer.actions.ShouldTrashCard(gameState, Cards.Raze))
            {
                if (currentPlayer.MoveCardFromPlayToTrash(gameState))
                    trashedCard = Cards.Raze;
            }
            else
            {
                trashedCard = currentPlayer.RequestPlayerTrashCardFromHand(gameState, c => true, isOptional: false);
            }

            if (trashedCard == null)
                return;

            int cardsToLookAt = trashedCard.CurrentCoinCost(currentPlayer);
            if (cardsToLookAt == 0)
                return;

            currentPlayer.LookAtCardsFromDeck(cardsToLookAt, gameState);
            currentPlayer.RequestPlayerMoveRevealedCardToHand(gameState, c => true);
            currentPlayer.MoveLookedAtCardsToDiscard(gameState);
        }
开发者ID:NathanTeeuwen,项目名称:Dominulator,代码行数:24,代码来源:Adventures.cs

示例12: DoSpecializedAction

        public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
        {
            PlayerActionChoice choice = currentPlayer.RequestPlayerChooseBetween(gameState,
                acceptableChoice => acceptableChoice == PlayerActionChoice.GainCard || acceptableChoice == PlayerActionChoice.Trash);

            if (choice == PlayerActionChoice.GainCard)
            {
                currentPlayer.RequestPlayerGainCardFromTrash(gameState,
                    acceptableCard => CardValidToGainFromTrash(acceptableCard, currentPlayer),
                    "Must gain a card costing between 3 and 6",
                    defaultLocation: DeckPlacement.TopOfDeck);
            }
            else
            {
                Card trashedCard = currentPlayer.RequestPlayerTrashCardFromHand(gameState, acceptableCard => CardValidToTrash(acceptableCard), isOptional: false);
                if (trashedCard != null)
                {
                    int maxCost = trashedCard.CurrentCoinCost(currentPlayer) + 3;
                    currentPlayer.RequestPlayerGainCardFromSupply(gameState,
                        acceptableCard => acceptableCard.CurrentCoinCost(currentPlayer) <= maxCost && acceptableCard.potionCost <= trashedCard.potionCost,
                        "gain a card costing up to 3 more than the trashed card");
                }
            }
        }
开发者ID:NathanTeeuwen,项目名称:Dominulator,代码行数:24,代码来源:DarkAges.cs


注:本文中的Dominion.PlayerState.RequestPlayerTrashCardFromHand方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。