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


C# PlayerState.RequestPlayerGainCardFromSupply方法代码示例

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


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

示例1: DoSpecializedWhenGain

        public override DeckPlacement DoSpecializedWhenGain(PlayerState currentPlayer, GameState gameState)
        {
            currentPlayer.RequestPlayerGainCardFromSupply(
                gameState,
                card => card.CurrentCoinCost(currentPlayer) < this.CurrentCoinCost(currentPlayer) && card.potionCost == 0,
                "Must gain a card costing less than this");

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

示例2: 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

示例3: DoSpecializedAction

 public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
 {
     currentPlayer.RequestPlayerGainCardFromSupply(gameState, card => card.isTreasure, "Gain a Treasure");
 }
开发者ID:NathanTeeuwen,项目名称:Dominulator,代码行数:4,代码来源:Adventures.cs

示例4: DoSpecializedAction

 public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
 {
     currentPlayer.MoveCardFromPlayToTrash(gameState);
     currentPlayer.RequestPlayerGainCardFromSupply(
         gameState,
         card => card.CurrentCoinCost(currentPlayer) <= 5 && card.potionCost == 0
         , "cost of card up to 5");
 }
开发者ID:NathanTeeuwen,项目名称:Dominulator,代码行数:8,代码来源:BaseSet.cs

示例5: DoSpecializedAction

 public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
 {
     currentPlayer.RequestPlayerGainCardFromSupply(gameState, card => card.isAction && card.CurrentCoinCost(currentPlayer) <= 5 && card.potionCost == 0,
          "May gain an action card costing up to 5",
          isOptional:true);
 }
开发者ID:NathanTeeuwen,项目名称:Dominulator,代码行数:6,代码来源:Alchemy.cs

示例6: DoSpecializedActionOnBuyWhileInPlay

 private new void DoSpecializedActionOnBuyWhileInPlay(PlayerState currentPlayer, GameState gameState, Card boughtCard)
 {
     currentPlayer.RequestPlayerGainCardFromSupply(gameState,
         card => !card.isVictory && card.CurrentCoinCost(currentPlayer) < boughtCard.CurrentCoinCost(currentPlayer) && card.potionCost <= boughtCard.potionCost,
         "Must gain a non victory card costing less than the bought card");
 }
开发者ID:peterhal,项目名称:Dominulator,代码行数:6,代码来源:Hinterlands.cs

示例7: DoSpecializedAction

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

            int trashedCardCost = trashedCard.CurrentCoinCost(currentPlayer);

            currentPlayer.RequestPlayerGainCardFromSupply(gameState, card => card.CurrentCoinCost(currentPlayer) == (trashedCardCost - 1) && card.potionCost == trashedCard.potionCost, "Must gain a card costing one less than the trashed card.", isOptional: false, defaultLocation: DeckPlacement.TopOfDeck);
            currentPlayer.RequestPlayerGainCardFromSupply(gameState, card => card.CurrentCoinCost(currentPlayer) == (trashedCardCost + 1) && card.potionCost == trashedCard.potionCost, "Must gain a card costing exactly one more than the trashed card.", isOptional: false, defaultLocation: DeckPlacement.TopOfDeck);

            // TODO:  put the cards on top of your deck in either order.
            //throw new NotImplementedException();
        }
开发者ID:peterhal,项目名称:Dominulator,代码行数:12,代码来源:Hinterlands.cs

示例8: DoSpecializedAction

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

            PlayerState.AttackAction attackAction = this.DoEmptyAttack;

            if (trashedCard != null)
            {
                attackAction = delegate(PlayerState currentPlayer2, PlayerState otherPlayer, GameState gameState2)
                {
                    if (otherPlayer.Hand.Count >= 5)
                    {
                        otherPlayer.DiscardCardFromHand(gameState, trashedCard);
                    }
                };

                currentPlayer.RequestPlayerGainCardFromSupply(gameState,
                    acceptableCard => acceptableCard.isTreasure &&
                                      acceptableCard.CurrentCoinCost(currentPlayer) <= trashedCard.CurrentCoinCost(currentPlayer) + 3 &&
                                      acceptableCard.potionCost == 0,
                    "Gain a card costing up to 3 more than the trashed card",
                    isOptional: false,
                    defaultLocation: DeckPlacement.TopOfDeck);
            }

            currentPlayer.AttackOtherPlayers(gameState, attackAction);
        }
开发者ID:NathanTeeuwen,项目名称:Dominulator,代码行数:27,代码来源:Guilds.cs

示例9: DoSpecializedAction

        public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
        {
            currentPlayer.RequestPlayerTrashCardFromHandOrDiscard(gameState,
                CanTrashCard,
                isOptional: true);

            currentPlayer.RequestPlayerGainCardFromSupply(gameState,
                acceptableCard => acceptableCard.CurrentCoinCost(currentPlayer) <= 3 && acceptableCard.potionCost == 0,
                "Gain a card costing up to 3");
        }
开发者ID:peterhal,项目名称:Dominulator,代码行数:10,代码来源:DarkAges.cs

示例10: DoSpecializedTrash

 public override void DoSpecializedTrash(PlayerState currentPlayer, GameState gameState)
 {
     currentPlayer.RequestPlayerGainCardFromSupply(gameState,
         card => card.CurrentCoinCost(currentPlayer) < this.CurrentCoinCost(currentPlayer) &&
                 card.potionCost == 0,
         "Must gain a card cheaper than this");
 }
开发者ID:peterhal,项目名称:Dominulator,代码行数:7,代码来源:DarkAges.cs

示例11: DoSpecializedAction

        public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
        {
            bool someOtherPlayerRevealedProvince = false;

            bool didRevealProvince = currentPlayer.RequestPlayerRevealCardFromHand(card => card == Cards.Province, gameState) != null;

            foreach (PlayerState player in gameState.players.OtherPlayers)
            {
                someOtherPlayerRevealedProvince |= player.RequestPlayerRevealCardFromHand(card => card == Cards.Province, gameState) != null;
                player.MoveAllRevealedCardsToHand();
            }

            if (didRevealProvince)
            {
                currentPlayer.RequestPlayerGainCardFromSupply(gameState,
                    card => card == Cards.Duchy || card.IsType(Cards.Prize),
                    "Must gain a duchy or a prize",
                    isOptional: false,
                    defaultLocation: DeckPlacement.TopOfDeck);
            }

            if (!someOtherPlayerRevealedProvince)
            {
                currentPlayer.DrawOneCardIntoHand(gameState);
                currentPlayer.AddCoins(1);
            }
        }
开发者ID:NathanTeeuwen,项目名称:Dominulator,代码行数:27,代码来源:Cornucopia.cs

示例12: DoSpecializedAction

        public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
        {
            // TODO: trashing potion card is included in total cost
            // throw NotImplemented()
            Card[] trashedCards = currentPlayer.RequestPlayerTrashCardsFromHand(gameState, currentPlayer.Hand.Count, isOptional: true);

            int totalCost = trashedCards.Select(card => card.CurrentCoinCost(currentPlayer)).Sum();
            currentPlayer.RequestPlayerGainCardFromSupply(
                gameState,
                card => card.CurrentCoinCost(currentPlayer) == totalCost,
                "Must gain a card costing exactly equal to the total cost of the trashed cards>",
                isOptional: false);
        }
开发者ID:peterhal,项目名称:Dominulator,代码行数:13,代码来源:Prosperity.cs

示例13: 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

示例14: OverpayOnPurchase

 public override void OverpayOnPurchase(PlayerState currentPlayer, GameState gameState, int overpayAmount)
 {
     // todo:  over pay by potion
     // throw new NotImplementedException()
     for (int i = 0; i < 2; ++i)
     {
         currentPlayer.RequestPlayerGainCardFromSupply(
             gameState,
             acceptableCard => acceptableCard.isAction && acceptableCard.CurrentCoinCost(currentPlayer) == overpayAmount,
             "Must gain 2 action cards costing the amount overpaid");
     }
 }
开发者ID:NathanTeeuwen,项目名称:Dominulator,代码行数:12,代码来源:Guilds.cs

示例15: DoSpecializedAction

        public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
        {
            CollectionCards trashedCards = currentPlayer.RequestPlayerTrashCardsFromHand(gameState, currentPlayer.Hand.Count, isOptional: true);

            int totalCoinCost = trashedCards.Select(card => card.CurrentCoinCost(currentPlayer)).Sum();
            int totalPotionCost = trashedCards.Select(card => card.potionCost).Sum();

            currentPlayer.RequestPlayerGainCardFromSupply(
                gameState,
                card => card.CurrentCoinCost(currentPlayer) == totalCoinCost && card.potionCost == totalPotionCost,
                "Must gain a card costing exactly equal to the total cost of the trashed cards>",
                isOptional: false);
        }
开发者ID:NathanTeeuwen,项目名称:Dominulator,代码行数:13,代码来源:Prosperity.cs


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