本文整理汇总了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);
}
示例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);
}
}
示例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();
}
}
示例4: Play
public void Play(TurnContext context)
{
context.DrawCards(3);
if (context.ActivePlayer.Hand.CardCount > 0)
context.AddSingleActivity(Activities.PutCardFromHandOnTopOfDeck(context, this), this);
}
示例5: Play
public void Play(TurnContext context)
{
context.AddSingleActivity(
Activities.GainACardCostingUpToX(context.Game.Log, context.ActivePlayer, 4, this), this);
}
示例6: Play
public void Play(TurnContext context)
{
context.RemainingActions += 2;
context.AddSingleActivity(
Activities.GainAnActionCardCostingUpToX(context.Game.Log, context.ActivePlayer, 5, this, true), this);
}
示例7: Play
public void Play(TurnContext context)
{
context.RemainingActions += 1;
context.AddSingleActivity(Activities.DiscardCardsToDrawCards(context, this), this);
}