本文整理汇总了C#中Parameters.CustomTestAllow方法的典型用法代码示例。如果您正苦于以下问题:C# Parameters.CustomTestAllow方法的具体用法?C# Parameters.CustomTestAllow怎么用?C# Parameters.CustomTestAllow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Parameters
的用法示例。
在下文中一共展示了Parameters.CustomTestAllow方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Test
public bool Test(Parameters parameters, string name, SimDescription sim, SimDescription potential, bool testScore, out int score)
{
score = 0;
if (SimTypes.IsDead(potential))
{
parameters.IncStat(name + " Dead Fail");
return false;
}
if (!parameters.CustomTestAllow (potential))
{
parameters.IncStat(name + " Custom Fail");
return false;
}
if ((mCustomTest.Valid) && (!mCustomTest.Invoke<bool>(new object[] { parameters, sim, potential })))
{
parameters.IncStat(name + " Custom Test Fail");
return false;
}
parameters.IncStat("Testing " + potential.FullName, Common.DebugLevel.Logging);
CASAgeGenderFlags age = (mAgeGender & CASAgeGenderFlags.AgeMask);
if ((age == CASAgeGenderFlags.None) && (potential.ToddlerOrBelow))
{
parameters.IncStat(name + " Too Young");
return false;
}
else if ((age != CASAgeGenderFlags.None) && ((mAgeGender & potential.Age) != potential.Age))
{
parameters.IncStat(name + " Age Fail");
return false;
}
else if (((mAgeGender & CASAgeGenderFlags.GenderMask) != CASAgeGenderFlags.None) && ((mAgeGender & potential.Gender) != potential.Gender))
{
parameters.IncStat(name + " Gender Fail");
return false;
}
else if (!mSpecies.Contains(potential.Species))
{
parameters.IncStat(name + " Species Fail");
return false;
}
if ((!mAllowAffair) && (parameters.mIsRomantic) && (sim != null))
{
if (((potential.Partner != null) || (sim.Partner != null)) && (potential.Partner != sim))
{
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)
//.........这里部分代码省略.........