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


C# SimDescription.MergeTravelInformation方法代码示例

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


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

示例1: MergeTravelInformation

        public static void MergeTravelInformation(SimDescription dest, SimDescription source, bool destHomeworld)
        {
            Common.StringBuilder msg = new Common.StringBuilder("MergeTravelInformation " + dest.FullName + Common.NewLine);

            try
            {
                msg += "A";
                Traveler.InsanityWriteLog(msg);

                OccupationNames sourceGuid = OccupationNames.Undefined;
                if (source.Occupation != null)
                {
                    sourceGuid = source.Occupation.Guid;
                }

                OccupationNames destGuid = OccupationNames.Undefined;
                if (dest.Occupation != null)
                {
                    destGuid = dest.Occupation.Guid;
                }

                if ((!destHomeworld) || (sourceGuid != destGuid))
                {
                    msg += "A1";
                    Traveler.InsanityWriteLog(msg);

                    if ((!destHomeworld) || (source.Occupation != null))
                    {
                        dest.CareerManager.mJob = source.Occupation;
                        if (dest.Occupation != null)
                        {
                            dest.Occupation.OwnerDescription = dest;
                        }

                        source.CareerManager.mJob = null;
                    }
                }
                else
                {
                    msg += "A2";
                    Traveler.InsanityWriteLog(msg);

                    // Update career piece-wise
                    foreach (ICareerMerger merger in Common.DerivativeSearch.Find<ICareerMerger>())
                    {
                        msg += Common.NewLine + merger.GetType().ToString();
                        Traveler.InsanityWriteLog(msg);

                        merger.IPerform(dest.Occupation, source.Occupation);
                    }
                }

                msg += Common.NewLine + "B";
                Traveler.InsanityWriteLog(msg);

                // Custom
                //   The MergeOccults in MergeTravelInformation can fail when removing occults
                OccultManagerEx.MergeOccults(dest.OccultManager, source.OccultManager);

                msg += "C";
                Traveler.InsanityWriteLog(msg);

                // Original Function
                dest.MergeTravelInformation(source);

                msg += "D";
                Traveler.InsanityWriteLog(msg);

                TrickSkill sourceTrickSkill = source.SkillManager.GetSkill<TrickSkill>(SkillNames.Trick);
                if (sourceTrickSkill != null)
                {
                    TrickSkill destTrickSkill = dest.SkillManager.AddElement(SkillNames.Trick) as TrickSkill;
                    if (destTrickSkill != null)
                    {
                        destTrickSkill.mExhibitionsPerformed = sourceTrickSkill.mExhibitionsPerformed;
                        destTrickSkill.mMoneyEarnedFromExhibitions = sourceTrickSkill.mMoneyEarnedFromExhibitions;
                        destTrickSkill.mTricks = sourceTrickSkill.mTricks;
                    }
                }

                msg += "E";
                Traveler.InsanityWriteLog(msg);

                CatHuntingSkill sourceCatSkill = source.SkillManager.GetSkill<CatHuntingSkill>(SkillNames.CatHunting);
                if (sourceCatSkill != null)
                {
                    CatHuntingSkill destCatSkill = dest.SkillManager.AddElement(SkillNames.CatHunting) as CatHuntingSkill;
                    if (destCatSkill != null)
                    {
                        destCatSkill.mOppCreepingAndCrawlingIsNew = sourceCatSkill.mOppCreepingAndCrawlingIsNew;
                        destCatSkill.mOppSlitherStalkerIsNew = sourceCatSkill.mOppSlitherStalkerIsNew;
                        destCatSkill.mOppFelineFisherIsNew = sourceCatSkill.mOppFelineFisherIsNew;
                        destCatSkill.mOppHomingWhiskersIsNew = sourceCatSkill.mOppHomingWhiskersIsNew;
                    }
                }

                msg += "F";
                Traveler.InsanityWriteLog(msg);

                DogHuntingSkill sourceDogSkill = source.SkillManager.GetSkill<DogHuntingSkill>(SkillNames.DogHunting);
//.........这里部分代码省略.........
开发者ID:Robobeurre,项目名称:NRaas,代码行数:101,代码来源:SimDescriptionEx.cs


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