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


C# TurnContext.AddSingleActivity方法代码示例

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


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

示例1: Play

        public void Play(TurnContext context)
        {
            var activity = Activities.GainACardCostingUpToX(context.Game.Log, context.ActivePlayer, 4, this);
            activity.AfterCardGained = card =>
            {
                if (card is IActionCard) context.RemainingActions += 1;
                if (card is ITreasureCard) context.AvailableSpend += 1;
                if (card is IVictoryCard) context.DrawCards(1);
            };

            context.AddSingleActivity(activity, this);
        }
开发者ID:razzielx,项目名称:Dominion,代码行数:12,代码来源:Ironworks.cs

示例2: Play

        public void Play(TurnContext context)
        {
            if(context.ActivePlayer.Hand.CardCount > 0)
            {
                var gainUtility = new GainUtility(context, context.ActivePlayer);

                var activity = Activities.SelectACardToTrash(context, context.ActivePlayer, this, card =>
                {
                    if (card is IActionCard) gainUtility.Gain<Duchy>();
                    if (card is ITreasureCard) gainUtility.Gain<Transmute>();
                    if (card is IVictoryCard) gainUtility.Gain<Gold>();
                });

                context.AddSingleActivity(activity, this);
            }
        }
开发者ID:razzielx,项目名称:Dominion,代码行数:16,代码来源:Transmute.cs

示例3: Play

        public void Play(TurnContext context)
        {
            var gainUtility = new GainUtility(context, context.ActivePlayer);
            Action gainSilver = () => gainUtility.Gain<Silver>(context.ActivePlayer.Hand);
            Action gainGold = () => gainUtility.Gain<Gold>(context.ActivePlayer.Hand);

            if (context.ActivePlayer.Hand.OfType<Province>().Any())
            {
                var activity = Activities.ChooseYesOrNo(
                    context.Game.Log,
                    context.ActivePlayer,
                    "Reveal a Province to gain a Gold?",
                    this,
                    gainGold,
                    gainSilver);
                context.AddSingleActivity(activity, this);
            }
            else
            {
                gainSilver();
            }
        }
开发者ID:razzielx,项目名称:Dominion,代码行数:22,代码来源:Explorer.cs

示例4: Play

 public void Play(TurnContext context)
 {
     context.DrawCards(3);
     if (context.ActivePlayer.Hand.CardCount > 0)
         context.AddSingleActivity(Activities.PutCardFromHandOnTopOfDeck(context, this), this);
 }
开发者ID:razzielx,项目名称:Dominion,代码行数:6,代码来源:Courtyard.cs

示例5: Play

 public void Play(TurnContext context)
 {
     context.AddSingleActivity(
         Activities.GainACardCostingUpToX(context.Game.Log, context.ActivePlayer, 4, this), this);
 }
开发者ID:razzielx,项目名称:Dominion,代码行数:5,代码来源:Workshop.cs

示例6: Play

 public void Play(TurnContext context)
 {
     context.RemainingActions += 2;
     context.AddSingleActivity(
         Activities.GainAnActionCardCostingUpToX(context.Game.Log, context.ActivePlayer, 5, this, true), this);
 }
开发者ID:razzielx,项目名称:Dominion,代码行数:6,代码来源:University.cs

示例7: Play

 public void Play(TurnContext context)
 {
     context.RemainingActions += 1;
     context.AddSingleActivity(Activities.DiscardCardsToDrawCards(context, this), this);
 }
开发者ID:razzielx,项目名称:Dominion,代码行数:5,代码来源:Cellar.cs


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