本文整理汇总了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);
//.........这里部分代码省略.........