本文整理汇总了C#中SimDescription.GetCASAGSAvailabilityFlags方法的典型用法代码示例。如果您正苦于以下问题:C# SimDescription.GetCASAGSAvailabilityFlags方法的具体用法?C# SimDescription.GetCASAGSAvailabilityFlags怎么用?C# SimDescription.GetCASAGSAvailabilityFlags使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimDescription
的用法示例。
在下文中一共展示了SimDescription.GetCASAGSAvailabilityFlags方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Run
protected override bool Run(SimDescription me, bool singleSelection)
{
List<SimTrait.Item> allOptions = new List<SimTrait.Item>();
foreach (Sims3.Gameplay.ActorSystems.Trait trait in TraitManager.GetDictionaryTraits)
{
if (trait.IsReward) continue;
if (!trait.TraitValidForAgeSpecies(me.GetCASAGSAvailabilityFlags())) continue;
int count = 0;
if (me.TraitManager.mUniversityGraduateTraitGuid == trait.Guid)
{
count = 1;
}
else if (me.HasTrait(trait.Guid))
{
continue;
}
allOptions.Add(new SimTrait.Item (trait.Guid, count));
}
SimTrait.Item selection = new CommonSelection<SimTrait.Item>(Name, me.FullName, allOptions, new SimTrait.AuxillaryColumn()).SelectSingle();
if (selection == null) return false;
TraitNames traitName = selection.Value;
me.RemoveUniversityGraduateTrait();
if (traitName != me.TraitManager.mUniversityGraduateTraitGuid)
{
Sims3.Gameplay.ActorSystems.Trait selTrait = TraitManager.GetTraitFromDictionary(traitName);
if (selTrait != null)
{
me.TraitManager.mUniversityGraduateTraitEnabled = true;
me.AddUniversityGraduateTrait(selTrait);
}
}
if ((me.CreatedSim != null) && (me.CreatedSim.SocialComponent != null))
{
me.CreatedSim.SocialComponent.UpdateTraits();
}
return true;
}
示例2: Run
protected override bool Run(SimDescription me, bool singleSelection)
{
List<SimTrait.Item> allOptions = new List<SimTrait.Item>();
foreach (Sims3.Gameplay.ActorSystems.Trait trait in TraitManager.GetDictionaryTraits)
{
if (trait.IsReward) continue;
if (trait.Guid == TraitNames.DescendantHiddenTrait) continue;
if (!trait.TraitValidForAgeSpecies(me.GetCASAGSAvailabilityFlags())) continue;
if (trait.RobotOnly) continue;
int count = 0;
if (me.TraitManager.HasElement(trait.Guid))
{
count = 1;
}
allOptions.Add(new SimTrait.Item (trait.Guid, count));
}
CommonSelection<SimTrait.Item>.Results selection = new CommonSelection<SimTrait.Item>(Name, me.FullName, allOptions, new SimTrait.AuxillaryColumn()).SelectMultiple();
if (selection.Count == 0) return false;
foreach (SimTrait.Item item in selection)
{
if (item == null) continue;
TraitNames traitName = item.Value;
Sims3.Gameplay.ActorSystems.Trait trait = TraitManager.GetTraitFromDictionary(traitName);
if (trait != null)
{
if (me.TraitManager.HasElement(traitName))
{
if (me.TraitManager.mSocialGroupTraitGuid == traitName)
{
me.RemoveSocialGroupTrait();
}
else if (me.TraitManager.mUniversityGraduateTraitGuid == traitName)
{
me.RemoveUniversityGraduateTrait();
}
else
{
me.RemoveTrait(trait);
}
}
else
{
int iTraitsForBabiesAndToddlers = TraitManager.kTraitsForBabiesAndToddlers;
int iTraitsForChildren = TraitManager.kTraitsForChildren;
int iTraitsForTeens = TraitManager.kTraitsForTeens;
int iTraitsForYoungAdultAndOlder = TraitManager.kTraitsForYoungAdultAndOlder;
try
{
// Don't use MaxValue as EA adds to this number for [[University]] purposes
TraitManager.kTraitsForBabiesAndToddlers = 10000000;
TraitManager.kTraitsForChildren = 10000000;
TraitManager.kTraitsForTeens = 10000000;
TraitManager.kTraitsForYoungAdultAndOlder = 10000000;
if (trait.IsHidden)
{
me.TraitManager.AddHiddenElement(traitName);
}
else
{
me.AddTrait(trait);
}
}
finally
{
TraitManager.kTraitsForBabiesAndToddlers = iTraitsForBabiesAndToddlers;
TraitManager.kTraitsForChildren = iTraitsForChildren;
TraitManager.kTraitsForTeens = iTraitsForTeens;
TraitManager.kTraitsForYoungAdultAndOlder = iTraitsForYoungAdultAndOlder;
}
}
}
}
if ((me.CreatedSim != null) && (me.CreatedSim.SocialComponent != null))
{
me.CreatedSim.SocialComponent.UpdateTraits();
}
if (me.TraitManager.CountVisibleTraits() > me.TraitManager.NumTraitsForAge())
{
Common.Notify(Common.Localize("ChangeTraits:MaxExceeded", me.IsFemale, new object[] { me, me.TraitManager.CountVisibleTraits(), me.TraitManager.NumTraitsForAge() }));
}
return true;
}