本文整理汇总了C#中Parameters.AddStat方法的典型用法代码示例。如果您正苦于以下问题:C# Parameters.AddStat方法的具体用法?C# Parameters.AddStat怎么用?C# Parameters.AddStat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Parameters
的用法示例。
在下文中一共展示了Parameters.AddStat方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Test
//.........这里部分代码省略.........
parameters.IncStat(name + " Affair Denied");
return false;
}
}
if ((sim != null) && (sim != potential))
{
if ((mStandardDisallowPartner) && (sim.Partner == potential))
{
parameters.IncStat(name + " Partner Fail");
return false;
}
if ((!mAllowOpposing) && (StoryProgression.Main.Personalities.IsOpposing(parameters, sim, potential, false)))
{
parameters.IncStat(name + " Clan Opposing Fail");
return false;
}
if (!parameters.mIsFriendly)
{
if (StoryProgression.Main.Personalities.IsFriendly(parameters, sim, potential))
{
parameters.IncStat(name + " Clan Friendly Denied");
return false;
}
}
int liking = 0;
Relationship relation = Relationship.Get(sim, potential, false);
if (relation != null)
{
liking = (int)relation.LTR.Liking;
}
if (liking < mRelationshipMinimum)
{
parameters.IncStat(name + " Relationship Underscore");
return false;
}
else if (liking > mRelationshipMaximum)
{
parameters.IncStat(name + " Relationship Overscore");
return false;
}
}
foreach (IValueTestOption value in mValueTestOptions)
{
if (!value.Satisfies())
{
parameters.IncStat(name + " " + value.ToString() + " Value Fail");
return false;
}
}
foreach (AgeGenderOption ageGender in mAgeGenderOptions)
{
if (!ageGender.Satisfies(potential.Age, potential.Gender, potential.Species))
{
parameters.IncStat(name + " " + ageGender.Name + " User Fail");
return false;
}
}
if (mDisallowRelated)
{
if (parameters.mManager.Flirts.IsCloselyRelated(sim, potential))
{
parameters.IncStat(name + " Closely Related");
return false;
}
}
if ((testScore) && (Score(potential, sim, parameters.mAbsoluteScoring, out score)))
{
int scoringMinimum = mScoringMinimum + parameters.mScoreDelta;
int scoringMaximum = mScoringMaximum + parameters.mScoreDelta;
if (score < scoringMinimum)
{
parameters.AddScoring(name + " Under Scoring Fail", score);
return false;
}
else if (score > scoringMaximum)
{
parameters.AddScoring(name + " Over Scoring Fail", score);
return false;
}
parameters.AddStat(name + " Score Success", score);
return true;
}
else
{
parameters.IncStat(name + " No Scoring");
return true;
}
}
示例2: Filter
public ICollection<SimDescription> Filter(Parameters parameters, string name, SimDescription sim, ICollection<SimDescription> potentials)
{
if (!mEnabled)
{
parameters.IncStat(name + " Disabled");
if (parameters.mDefaultAll)
{
return parameters.mManager.Sims.All;
}
else
{
return potentials;
}
}
Collect(sim);
if ((sim != null) && (potentials == null))
{
switch (mStandardFilter)
{
case StandardFilter.Me:
potentials = new List<SimDescription>();
potentials.Add(sim);
break;
case StandardFilter.Partner:
potentials = new List<SimDescription>();
if (sim.Partner != null)
{
potentials.Add(sim.Partner);
}
break;
case StandardFilter.AnyFlirt:
potentials = parameters.mManager.Flirts.FindAnyFor(parameters, sim, mAllowAffair, false);
break;
case StandardFilter.ExistingFriend:
potentials = parameters.mManager.Friends.FindExistingFriendFor(parameters, sim, mStandardGate, mStandardIgnoreBusy);
break;
case StandardFilter.Partnered:
potentials = parameters.mManager.Romances.FindPartneredFor(sim);
break;
case StandardFilter.ExistingFlirt:
potentials = parameters.mManager.Flirts.FindExistingFor(parameters, sim, mStandardDisallowPartner);
break;
case StandardFilter.ExistingOrAnyFlirt:
potentials = parameters.mManager.Flirts.FindExistingFor(parameters, sim, mStandardDisallowPartner);
if ((potentials == null) || (potentials.Count == 0))
{
potentials = parameters.mManager.Flirts.FindAnyFor(parameters, sim, mAllowAffair, false);
}
break;
case StandardFilter.ExistingEnemy:
potentials = parameters.mManager.Friends.FindExistingEnemyFor(parameters, sim, mStandardGate, mStandardIgnoreBusy);
break;
case StandardFilter.Nemesis:
potentials = parameters.mManager.Friends.FindNemesisFor(parameters, sim, mStandardIgnoreBusy);
break;
}
if (potentials != null)
{
parameters.AddStat(name + " " + mStandardFilter.ToString(), potentials.Count);
}
}
SimPersonality clan = parameters.mManager as SimPersonality;
if (!string.IsNullOrEmpty(mClan))
{
clan = parameters.mManager.Personalities.GetPersonality(mClan);
if (clan == null)
{
parameters.IncStat(mClan + " Missing");
return new List<SimDescription>();
}
}
if (clan != null)
{
if (potentials == null)
{
if (mClanMembers)
{
potentials = clan.GetClanMembers(mClanLeader);
parameters.mIsFriendly = true;
}
else if (mClanLeader)
{
potentials = clan.MeAsList;
parameters.mIsFriendly = true;
}
if (potentials != null)
{
parameters.AddStat(name + " Clan", potentials.Count);
}
}
//.........这里部分代码省略.........