本文整理汇总了C#中SimDescription.GetOutfitCount方法的典型用法代码示例。如果您正苦于以下问题:C# SimDescription.GetOutfitCount方法的具体用法?C# SimDescription.GetOutfitCount怎么用?C# SimDescription.GetOutfitCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimDescription
的用法示例。
在下文中一共展示了SimDescription.GetOutfitCount方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Perform
protected override void Perform(SimDescription sim, CASParts.Key outfitKey, CASParts.Key displayKey)
{
CASParts.Key currentKey = new CASParts.Key(sim.CreatedSim);
if (outfitKey == currentKey) return;
switch (outfitKey.mCategory)
{
case OutfitCategories.Everyday:
case OutfitCategories.Athletic:
case OutfitCategories.Formalwear:
case OutfitCategories.Swimwear:
case OutfitCategories.Sleepwear:
case OutfitCategories.Career:
case OutfitCategories.Outerwear:
// Don't allow the user to remove the last of a category
if (sim.GetOutfitCount(outfitKey.mCategory) == 1) return;
break;
}
CASParts.RemoveOutfit(sim, outfitKey, false);
}
示例2: GetCategories
protected override IEnumerable<OutfitCategories> GetCategories(SimDescription sim)
{
List<OutfitCategories> results = new List<OutfitCategories>();
foreach (OutfitCategories category in new OutfitCategories[] { OutfitCategories.Everyday, OutfitCategories.Formalwear, OutfitCategories.Sleepwear, OutfitCategories.Swimwear, OutfitCategories.Athletic, OutfitCategories.MartialArts, OutfitCategories.Naked, OutfitCategories.Singed, OutfitCategories.Career, OutfitCategories.Outerwear })
{
int count = sim.GetOutfitCount(category);
switch (category)
{
case OutfitCategories.Naked:
case OutfitCategories.Singed:
break;
default:
if (count <= 1) continue;
break;
}
results.Add(category);
}
return results;
}
示例3: ValidateOutfit
public static void ValidateOutfit(SimDescription sim, ref SimOutfit outfit, ref int index)
{
if ((outfit == null) || !outfit.IsValid)
{
int count = sim.GetOutfitCount(OutfitCategories.Career);
if (count > 0)
{
outfit = sim.GetOutfit(OutfitCategories.Career, 0);
index = 0;
}
}
}
示例4: Restore
//.........这里部分代码省略.........
if (bandSkill != null)
{
bandSkill.mBandInfo = mBandInfo;
}
Collecting collecting = sim.SkillManager.GetSkill<Collecting>(SkillNames.Collecting);
if (collecting != null)
{
collecting.mGlowBugData = mGlowBugData;
collecting.mMushroomsCollected = mMushroomsCollected;
}
NectarSkill nectar = sim.SkillManager.GetSkill<NectarSkill>(SkillNames.Nectar);
if (nectar != null)
{
nectar.mHashesMade = mNectarHashesMade;
}
Photography photography = sim.SkillManager.GetSkill<Photography>(SkillNames.Photography);
if (photography != null)
{
// Forces a recalculation of the completion count
photography.mCollectionsCompleted = uint.MaxValue;
if (mSubjectRecords != null)
{
photography.mSubjectRecords = mSubjectRecords;
}
}
RidingSkill riding = sim.SkillManager.GetSkill<RidingSkill>(SkillNames.Riding);
if (riding != null)
{
if (mCrossCountryCompetitionsWon != null)
{
riding.mCrossCountryCompetitionsWon = mCrossCountryCompetitionsWon.ToArray();
}
if (mJumpCompetitionsWon != null)
{
riding.mJumpCompetitionsWon = mJumpCompetitionsWon.ToArray();
}
}
if (mOccult != null)
{
foreach (OccultBaseClass occult in mOccult)
{
if (OccultTypeHelper.Add(sim, occult.ClassOccultType, false, false))
{
OccultTransfer transfer = OccultTransfer.Get(occult.ClassOccultType);
if (transfer != null)
{
transfer.Perform(sim, occult);
}
}
}
}
mOccult = null;
if (mOutfitCache != null)
{
foreach (SavedOutfit.Cache.Key outfit in mOutfitCache.Outfits)
{
using (CASParts.OutfitBuilder builder = new CASParts.OutfitBuilder(sim, outfit.mKey, false))
{
builder.Builder.SkinTone = mSkinToneKey;
builder.Builder.SkinToneIndex = mSkinToneIndex;
outfit.Apply(builder, true, null, null);
}
}
foreach (SavedOutfit.Cache.Key outfit in mOutfitCache.AltOutfits)
{
using (CASParts.OutfitBuilder builder = new CASParts.OutfitBuilder(sim, outfit.mKey, true))
{
builder.Builder.SkinTone = mSkinToneKey;
builder.Builder.SkinToneIndex = mSkinToneIndex;
outfit.Apply(builder, true, null, null);
}
}
int count = 0;
int originalCount = mOutfitCache.GetOutfitCount(OutfitCategories.Everyday, false);
while ((originalCount > 0) && (originalCount < sim.GetOutfitCount(OutfitCategories.Everyday)) && (count < originalCount))
{
CASParts.RemoveOutfit(sim, new CASParts.Key(OutfitCategories.Everyday, sim.GetOutfitCount(OutfitCategories.Everyday)-1), false);
count++;
}
}
}
catch (Exception e)
{
Common.Exception(sim, e);
}
}
示例5: OnTest
public bool OnTest(SimDescription parent)
{
if (mChild == parent) return false;
if (parent.GetOutfitCount(OutfitCategories.Everyday) == 0) return false;
return (mChild.Species == parent.Species);
}
示例6: TestAndRebuildWerewolfOutfit
public static void TestAndRebuildWerewolfOutfit(SimDescription sim)
{
if (!sim.IsWerewolf) return;
if (sim.GetOutfitCount(OutfitCategories.Supernatural) == 0) return;
SimOutfit outfit = sim.GetOutfit(OutfitCategories.Supernatural, 0);
if ((outfit != null) && (outfit.SkinToneKey.InstanceId == 0x0))
{
RebuildWerewolfOutfit(sim);
}
}
示例7: Remove
public static bool Remove(SimDescription sim, OccultTypes type, bool alterOutfit)
{
if (sim.OccultManager == null) return false;
if (sim.CreatedSim != null)
{
try
{
if (sim.CreatedSim.CurrentOutfitCategory == OutfitCategories.Special)
{
sim.CreatedSim.SwitchToOutfitWithoutSpin(OutfitCategories.Everyday);
}
}
catch
{ }
}
OccultVampire vampire = sim.OccultManager.GetOccultType(type) as OccultVampire;
if (vampire != null)
{
if ((vampire.mOwningSim == null) || (vampire.mOwningSim.MapTagManager == null))
{
vampire.mPreyMapTag = null;
}
}
if (sim.GetOutfitCount(OutfitCategories.Everyday) == 1)
{
SimOutfit outfit = sim.GetOutfit(OutfitCategories.Everyday, 0);
using (CASParts.OutfitBuilder builder = new CASParts.OutfitBuilder(sim, new CASParts.Key(OutfitCategories.Everyday, 1), outfit))
{ }
}
if (type == OccultTypes.Unicorn)
{
OccultUnicornEx.OnRemoval(sim);
}
bool success = false;
OccultManager occultManager = sim.OccultManager;
try
{
if (occultManager.HasOccultType(type))
{
occultManager.mCurrentOccultTypes ^= type;
foreach (OccultBaseClass occultClass in occultManager.mOccultList)
{
if (type == occultClass.ClassOccultType)
{
if ((occultManager.mOwnerDescription.SupernaturalData != null) && (occultManager.mOwnerDescription.SupernaturalData.OccultType == type))
{
occultManager.mOwnerDescription.RemoveSupernaturalData();
}
OccultGenie genie = occultClass as OccultGenie;
if (genie != null)
{
OccultGenieEx.OnRemoval(genie, occultManager.mOwnerDescription, alterOutfit);
}
else
{
OccultPlantSim plantSim = occultClass as OccultPlantSim;
if (plantSim != null)
{
OccultPlantSimEx.OnRemoval(plantSim, occultManager.mOwnerDescription, alterOutfit);
}
else
{
occultClass.OnRemoval(occultManager.mOwnerDescription);
}
}
occultManager.mOccultList.Remove(occultClass);
occultManager.mIsLifetimeReward = false;
if (occultManager.mOccultList.Count == 0x0)
{
occultManager.mOccultList = null;
}
break;
}
}
(Responder.Instance.HudModel as Sims3.Gameplay.UI.HudModel).OnSimDaysPerAgingYearChanged();
occultManager.UpdateOccultUI();
EventTracker.SendEvent(EventTypeId.kLostOccult, occultManager.mOwnerDescription.CreatedSim);
}
//occultManager.RemoveOccultType(type);
success = true;
}
catch (Exception e)
{
bool showError = true;
switch (type)
{
//.........这里部分代码省略.........
示例8: OnTest
private static bool OnTest(SimDescription sim)
{
return (sim.GetOutfitCount(OutfitCategories.Everyday) > 0);
}
示例9: OnAddition
public static void OnAddition(OccultUnicorn ths, SimDescription simDes, bool alterOutfit)
{
if (alterOutfit)
{
if (simDes.HorseManager == null)
{
return;
}
Color[] maneColors = simDes.HorseManager.ActiveManeHairColors;
simDes.HorseManager.ActiveUnicornBeardHairColors = maneColors;
if (sParts == null)
{
sParts = CASParts.GetParts(PartMatches);
}
List<CASParts.PartPreset> parts = new List<CASParts.PartPreset>();
foreach (CASParts.Wrapper part in sParts)
{
if (!part.ValidFor(simDes)) continue;
CASParts.PartPreset preset = part.GetRandomPreset();
if (preset == null) continue;
parts.Add(preset);
}
if (parts.Count > 0)
{
GeneticsPet.SpeciesSpecificData speciesData = new GeneticsPet.SpeciesSpecificData();
speciesData.UnicornBeardHairColors = simDes.HorseManager.ActiveUnicornBeardHairColors;
foreach (OutfitCategories category in simDes.ListOfCategories)
{
switch (category)
{
case OutfitCategories.All:
case OutfitCategories.CategoryMask:
case OutfitCategories.None:
case OutfitCategories.PrimaryCategories:
case OutfitCategories.PrimaryHorseCategories:
case OutfitCategories.Special:
continue;
default:
for (int i = 0x0; i < simDes.GetOutfitCount(category); i++)
{
using (CASParts.OutfitBuilder builder = new CASParts.OutfitBuilder(simDes, new CASParts.Key(category, i)))
{
foreach (CASParts.PartPreset part in parts)
{
builder.Builder.RemoveParts(new BodyTypes[] { part.mPart.BodyType });
builder.ApplyPartPreset(part);
if (part.mPart.BodyType == BodyTypes.PetBeard)
{
OutfitUtils.AdjustPresetForHorseHairColor(builder.Builder, part.mPart, speciesData);
}
}
}
}
break;
}
}
if (simDes.CreatedSim != null)
{
simDes.CreatedSim.UpdateOutfitInfo();
simDes.CreatedSim.RefreshCurrentOutfit(false);
}
}
}
}
示例10: OnRemoval
public static void OnRemoval(SimDescription sim)
{
foreach (OutfitCategories category in sim.ListOfCategories)
{
switch (category)
{
case OutfitCategories.All:
case OutfitCategories.CategoryMask:
case OutfitCategories.None:
case OutfitCategories.PrimaryCategories:
case OutfitCategories.PrimaryHorseCategories:
case OutfitCategories.Special:
continue;
default:
for (int i = 0x0; i < sim.GetOutfitCount(category); i++)
{
using (CASParts.OutfitBuilder builder = new CASParts.OutfitBuilder(sim, new CASParts.Key(category, i)))
{
builder.Builder.RemoveParts(new BodyTypes[] { BodyTypes.PetBeard });
builder.Builder.RemoveParts(new BodyTypes[] { BodyTypes.PetHorn });
}
}
break;
}
}
if (sim.CreatedSim != null)
{
sim.CreatedSim.UpdateOutfitInfo();
sim.CreatedSim.RefreshCurrentOutfit(false);
}
}