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


C# SimDescription.GetOutfit方法代码示例

本文整理汇总了C#中SimDescription.GetOutfit方法的典型用法代码示例。如果您正苦于以下问题:C# SimDescription.GetOutfit方法的具体用法?C# SimDescription.GetOutfit怎么用?C# SimDescription.GetOutfit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SimDescription的用法示例。


在下文中一共展示了SimDescription.GetOutfit方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PrivateAllow

        protected override bool PrivateAllow(SimDescription me)
        {
            if (!base.PrivateAllow(me)) return false;

            if (me.GetOutfit(OutfitCategories.Everyday, 0) == null) return false;

            if (me.Household == null) return false;

            if (me.Household == Household.ActiveHousehold) return true;

            return (!SimTypes.IsTourist(me));
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:12,代码来源:RandomizeGenetics.cs

示例2: Transform

        public static void Transform(SimDescription sim)
        {
            if (!Hybrid.Settings.mSpecialWerewolfOutfit) return;

            SimOutfit outfit = sim.GetSpecialOutfit(sWerewolfOutfitKey);
            if (outfit == null)
            {
                SimOutfit sourceOutfit = sim.GetOutfit(OutfitCategories.Everyday, 0);

                foreach (CASPart part in sourceOutfit.Parts)
                {
                    if (part.BodyType == BodyTypes.FullBody)
                    {
                        return;
                    }
                }

                if (sParts == null)
                {
                    sParts = CASParts.GetParts(PartMatches);
                }

                List<CASParts.PartPreset> parts = new List<CASParts.PartPreset>();
                foreach (CASParts.Wrapper part in sParts)
                {
                    if (!part.ValidFor(sim)) continue;

                    if (RandomUtil.CoinFlip()) continue;

                    CASParts.PartPreset preset = part.GetRandomPreset();
                    if (preset == null) continue;

                    parts.Add(preset);
                }

                if (parts.Count > 0)
                {
                    using (CASParts.OutfitBuilder builder = new CASParts.OutfitBuilder(sim, new CASParts.Key(sWerewolfOutfitKey), sourceOutfit))
                    {
                        foreach (CASParts.PartPreset part in parts)
                        {
                            builder.Builder.RemoveParts(new BodyTypes[] { part.mPart.BodyType });
                            builder.ApplyPartPreset(part);
                        }
                    }
                }

                outfit = sim.GetSpecialOutfit(sWerewolfOutfitKey);
                if (outfit == null) return;
            }
            
            SwitchOutfits.SwitchNoSpin(sim.CreatedSim, new CASParts.Key(sWerewolfOutfitKey));
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:53,代码来源:WerewolfOutfitControl.cs

示例3: Perform

        public static Sim Perform(SimDescription ths, Vector3 position, SimOutfit outfit, OnReset reset)
        {
            try
            {
                ResourceKey outfitKey = ths.mDefaultOutfitKey;

                if (outfit == null)
                {
                    if (ths.IsHorse)
                    {
                        outfit = ths.GetOutfit(OutfitCategories.Naked, 0);
                    }
                    
                    if (outfit == null)
                    {
                        outfit = ths.GetOutfit(OutfitCategories.Everyday, 0);
                    }

                    if ((outfit == null) || (!outfit.IsValid))
                    {
                        return null;
                    }
                }

                if (outfit != null)
                {
                    outfitKey = outfit.Key;
                }

                return Perform(ths, position, outfitKey, true, reset);
            }
            catch (Exception e)
            {
                ths.mSim = null;

                ths.mDefaultOutfitKey = ResourceKey.kInvalidResourceKey;

                Common.Exception(ths, e);
            }

            return null;
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:42,代码来源:Instantiation.cs

示例4: GetFromNakedOutfit

        protected static List<CASParts.PartPreset> GetFromNakedOutfit(SimDescription sim, BodyTypes location)
        {
            SimOutfit outfit = sim.GetOutfit(OutfitCategories.Naked, 0);
            if (outfit == null) return new List<CASParts.PartPreset>();

            List<CASParts.PartPreset> results = new List<CASParts.PartPreset>();

            foreach (CASPart part in outfit.Parts)
            {
                if (location == BodyTypes.FullBody)
                {
                    if ((part.BodyType == BodyTypes.UpperBody) || (part.BodyType == BodyTypes.LowerBody))
                    {
                        results.Add(new CASParts.PartPreset(part, outfit));
                    }
                }
                else if (location == part.BodyType)
                {
                    results.Add(new CASParts.PartPreset(part, outfit));
                }
            }

            return results;
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:24,代码来源:CheckOutfitTask.cs

示例5: 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

示例6: Restore

            public void Restore(SimDescription sim)
            {
                try
                {
                    sim.mGenderPreferenceMale = mMalePreference;
                    sim.mGenderPreferenceFemale = mFemalePreference;

                    if (sim.Pregnancy != null)
                    {
                        sim.Pregnancy.mGender = mPregnantGender;
                    }

                    if (sim.CreatedSim != null)
                    {
                        if (mPreviousOutfitCategory != OutfitCategories.None)
                        {
                            SimOutfit outfit = sim.GetOutfit(mPreviousOutfitCategory, mPreviousOutfitIndex);
                            if (outfit != null)
                            {
                                sim.CreatedSim.mPreviousOutfitKey = outfit.Key;
                            }
                        }

                        if (sim.CreatedSim.DreamsAndPromisesManager != null)
                        {
                            ActiveDreamNode node = sim.CreatedSim.DreamsAndPromisesManager.LifetimeWishNode;
                            if (node != null)
                            {
                                node.InternalCount = mLifetimeWishTally;
                            }
                        }
                    }

                    foreach (TraitNames trait in mTraits)
                    {
                        if (sim.TraitManager.HasElement(trait)) continue;

                        sim.TraitManager.AddElement(trait);
                    }

                    SocialNetworkingSkill networkSkill = sim.SkillManager.GetSkill<SocialNetworkingSkill>(SkillNames.SocialNetworking);
                    if (networkSkill != null)
                    {
                        networkSkill.mNumberOfFollowers = mNumberOfFollowers;
                        networkSkill.mBlogsCreated = mBlogsCreated;
                    }

                    RockBand bandSkill = sim.SkillManager.GetSkill<RockBand>(SkillNames.RockBand);
                    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)
//.........这里部分代码省略.........
开发者ID:GnatGoSplat,项目名称:NRaas,代码行数:101,代码来源:CrossWorldControl.cs

示例7: CrossWorldData

            public CrossWorldData(SimDescription sim)
            {
                mName = sim.FullName;

                mOutfitCache = new SavedOutfit.Cache(sim);

                SimOutfit outfit = sim.GetOutfit(OutfitCategories.Everyday, 0);
                if (outfit != null)
                {
                    mSkinToneKey = outfit.SkinToneKey;
                    mSkinToneIndex = outfit.SkinToneIndex;
                }
                else
                {
                    mSkinToneKey = sim.SkinToneKey;
                    mSkinToneIndex = sim.SkinToneIndex;
                }

                mMalePreference = sim.mGenderPreferenceMale;
                mFemalePreference = sim.mGenderPreferenceFemale;

                if (sim.CreatedSim != null)
                {
                    if (sim.CreatedSim.mPreviousOutfitKey != null)
                    {
                        try
                        {
                            mPreviousOutfitCategory = sim.GetOutfitCategoryFromResKey(sim.CreatedSim.mPreviousOutfitKey, out mPreviousOutfitIndex);
                        }
                        catch
                        { }
                    }

                    if (sim.CreatedSim.DreamsAndPromisesManager != null)
                    {
                        ActiveDreamNode node = sim.CreatedSim.DreamsAndPromisesManager.LifetimeWishNode;
                        if (node != null)
                        {
                            mLifetimeWishTally = node.InternalCount;
                        }
                    }
                }

                if (sim.Pregnancy != null)
                {
                    mPregnantGender = sim.Pregnancy.mGender;
                }

                foreach (Trait trait in sim.TraitManager.List)
                {
                    if (trait.IsReward) continue;

                    mTraits.Add(trait.Guid);
                }

                SocialNetworkingSkill networkSkill = sim.SkillManager.GetSkill<SocialNetworkingSkill>(SkillNames.SocialNetworking);
                if (networkSkill != null)
                {
                    // This value is set to mNumberOfBlogFollowers for some reason
                    mNumberOfFollowers = networkSkill.mNumberOfFollowers;

                    // Not transitioned at all
                    mBlogsCreated = networkSkill.mBlogsCreated;
                }

                RockBand bandSkill = sim.SkillManager.GetSkill<RockBand>(SkillNames.RockBand);
                if (bandSkill != null)
                {
                    mBandInfo = bandSkill.mBandInfo;
                }

                Collecting collecting = sim.SkillManager.GetSkill<Collecting>(SkillNames.Collecting);
                if (collecting != null)
                {
                    // Error in CollectingPropertyStreamWriter:Export() requires that mGlowBugData by transfered manually
                    //   Exported as two Int64, but Imported as a Int64 and Int32
                    mGlowBugData = collecting.mGlowBugData;

                    mMushroomsCollected = collecting.mMushroomsCollected;
                }

                NectarSkill nectar = sim.SkillManager.GetSkill<NectarSkill>(SkillNames.Nectar);
                if (nectar != null)
                {
                    mNectarHashesMade = nectar.mHashesMade;
                }

                Photography photography = sim.SkillManager.GetSkill<Photography>(SkillNames.Photography);
                if (photography != null)
                {
                    mSubjectRecords = photography.mSubjectRecords;
                }

                RidingSkill riding = sim.SkillManager.GetSkill<RidingSkill>(SkillNames.Riding);
                if (riding != null)
                {
                    // Error in the Import (Copy/Paste fail by the looks of it), where the CrossCountry Wins are imported instead
                    mCrossCountryCompetitionsWon = new List<uint>(riding.mCrossCountryCompetitionsWon);
                    mJumpCompetitionsWon = new List<uint>(riding.mJumpCompetitionsWon);
                }
//.........这里部分代码省略.........
开发者ID:GnatGoSplat,项目名称:NRaas,代码行数:101,代码来源:CrossWorldControl.cs

示例8: 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

示例9: 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

示例10: UnpackSim

        public static SimDescription UnpackSim(MiniSimDescription ths, bool updateGenealogy)
        {
            try
            {
                if (ths == null) return null;

                // Calling ImportSimDescription prior to the Aging Manager being available is invalid, don't allow it
                if (AgingManager.Singleton == null) return null;

                SimDescription desc = new SimDescription();
                ResourceKeyContentCategory installed = ResourceKeyContentCategory.kInstalled;

                DownloadContent.ImportSimDescription(ths.mTravelKey, desc, ref installed);

                desc.SimDescriptionId = ths.mSimDescriptionId;

                if (desc.CareerManager != null)
                {
                    // Fixup for careers require a household, which is not set until later in this process

                    desc.CareerManager.mJob = null;
                    desc.CareerManager.mSchool = null;
                }

                desc.Fixup();

                if (updateGenealogy && !GameStates.IsTravelling)
                {
                    if (desc.DefaultOutfitKey == ResourceKey.kInvalidResourceKey)
                    {
                        SimOutfit outfit = desc.GetOutfit(OutfitCategories.Everyday, 0x0);
                        if ((outfit == null) || (!outfit.IsValid))
                        {
                            desc.Dispose(false, false);
                            return null;
                        }

                        desc.UpdateFromOutfit(OutfitCategories.Everyday);
                    }
                    desc.CASGenealogy = ths.CASGenealogy;
                }

                Corrections.CleanupBrokenSkills(desc, null);

                OccultTypeHelper.ValidateOccult(desc, null);

                return desc;
            }
            catch (Exception e)
            {
                Common.Exception(ths.FullName, e);
                return null;
            }
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:54,代码来源:MiniSims.cs

示例11: GenerateCrossWorldThumbnail

        public static void GenerateCrossWorldThumbnail(MiniSimDescription miniSim, SimDescription sim, bool forceGeneration)
        {
            if (forceGeneration || (sim.HomeWorld == GameUtils.GetCurrentWorld()))
            {
                ThumbnailTechnique technique = sim.IsDead ? ThumbnailTechnique.Sepia : ThumbnailTechnique.Default;

                ResourceKey travelThumbnailOutfitForSim = MiniSimDescription.GetTravelThumbnailOutfitForSim(sim);
                if (travelThumbnailOutfitForSim.InstanceId != 0x0L)
                {
                    ThumbnailManager.GenerateHouseholdSimThumbnail(travelThumbnailOutfitForSim, travelThumbnailOutfitForSim.InstanceId, 0x0, ThumbnailSizeMask.Large, technique, false, true, sim.AgeGenderSpecies);
                    ThumbnailManager.GenerateTravelSimThumbnail(travelThumbnailOutfitForSim, miniSim.mThumbKey.mDescKey.InstanceId, ThumbnailSizeMask.Large, technique);
                }
                else
                {
                    SimOutfit outfit = sim.GetOutfit(OutfitCategories.Everyday, 0);
                    if ((outfit != null) && (outfit.IsValid))
                    {
                        sim.mDefaultOutfitKey = outfit.Key;

                        ThumbnailManager.GenerateHouseholdSimThumbnail(sim.DefaultOutfitKey, sim.DefaultOutfitKey.InstanceId, 0, ThumbnailSizeMask.Large, technique, false, true, sim.AgeGenderSpecies);
                        ThumbnailManager.GenerateTravelSimThumbnail(sim.DefaultOutfitKey, miniSim.mThumbKey.mDescKey.InstanceId, ThumbnailSizeMask.Large, technique);
                    }
                }
            }
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:25,代码来源:MiniSims.cs


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