本文整理汇总了C#中Scenario.Add方法的典型用法代码示例。如果您正苦于以下问题:C# Scenario.Add方法的具体用法?C# Scenario.Add怎么用?C# Scenario.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Scenario
的用法示例。
在下文中一共展示了Scenario.Add方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Perform
public void Perform(Scenario scenario, ScenarioFrame frame, string name, SimDescription sim, SimDescription target)
{
scenario.IncStat(name);
foreach (KeyValuePair<BuffNames, Origin> value in mActorBuffs)
{
HandleBuff(sim.CreatedSim, value.Key, value.Value);
}
foreach (KeyValuePair<BuffNames, Origin> value in mTargetBuffs)
{
HandleBuff(target.CreatedSim, value.Key, value.Value);
}
mRecruit.Perform(scenario, sim, target);
mPropagate.Perform(scenario, frame, sim, target);
int minCelebrity = scenario.GetValue<ManagerPersonality.MinCelebrityOption, int>();
if (minCelebrity > 0)
{
SimPersonality personality = scenario.Manager as SimPersonality;
int actorCelebrity = mActorCelebrity;
if (actorCelebrity < minCelebrity)
{
actorCelebrity = minCelebrity;
}
if (actorCelebrity > 0)
{
scenario.Friends.AccumulateCelebrity(sim, actorCelebrity);
}
if ((personality != null) && (personality.Me != sim))
{
scenario.Friends.AccumulateCelebrity(personality.Me, actorCelebrity);
}
int targetCelebrity = mTargetCelebrity;
if (targetCelebrity < minCelebrity)
{
targetCelebrity = minCelebrity;
}
if (targetCelebrity > 0)
{
scenario.Friends.AccumulateCelebrity(target, targetCelebrity);
}
}
if (mAccumulatorOptions != null)
{
foreach (SimPersonality.IAccumulatorValue value in mAccumulatorOptions)
{
value.ApplyAccumulator();
}
}
Scenario newScenario = GetNewScenario(scenario.Manager, sim, target);
if (newScenario != null)
{
scenario.IncStat(newScenario.UnlocalizedName);
scenario.Add(frame, newScenario, ScenarioResult.Start);
}
SimPersonality clan = scenario.Manager as SimPersonality;
if ((sim != clan.Me) && (clan != null) && (clan.IsFriendlyLeadership))
{
int delta = mDelta.Score(new DualSimScoringParameters(sim, clan.Me));
if (delta < 0)
{
scenario.IncStat("ExistingEnemy");
scenario.Add(frame, new ExistingEnemyManualScenario(sim, clan.Me, delta, 0), ScenarioResult.Start);
}
else if (delta > 0)
{
scenario.IncStat("ExistingFriend");
scenario.Add(frame, new ExistingFriendManualScenario(sim, clan.Me, delta, 0), ScenarioResult.Start);
}
}
scenario.Add(frame, new SuccessScenario(), ScenarioResult.Start);
}