当前位置: 首页>>代码示例>>C#>>正文


C# SimDescription.GetOutfitCount方法代码示例

本文整理汇总了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);
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:21,代码来源:RemoveOutfit.cs

示例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;
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:23,代码来源:RemoveOutfit.cs

示例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;
         }
     }
 }
开发者ID:Chain-Reaction,项目名称:NRaas,代码行数:12,代码来源:Register.cs

示例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);
                }
            }
开发者ID:GnatGoSplat,项目名称:NRaas,代码行数:101,代码来源:CrossWorldControl.cs

示例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);
            }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:8,代码来源:PlayWithGenetics.cs

示例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);
            }
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:12,代码来源:OccultTypeHelper.cs

示例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)
                {
//.........这里部分代码省略.........
开发者ID:Robobeurre,项目名称:NRaas,代码行数:101,代码来源:OccultTypeHelper.cs

示例8: OnTest

 private static bool OnTest(SimDescription sim)
 {
     return (sim.GetOutfitCount(OutfitCategories.Everyday) > 0);
 }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:4,代码来源:CASGeneticsEx.cs

示例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);
                    }
                }
            }
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:72,代码来源:OccultUnicornEx.cs

示例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);
            }
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:32,代码来源:OccultUnicornEx.cs


注:本文中的SimDescription.GetOutfitCount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。