diff --git a/1.6/1.6/Assemblies/WulaFallenEmpire.dll b/1.6/1.6/Assemblies/WulaFallenEmpire.dll index cb8b7889..86af74e6 100644 Binary files a/1.6/1.6/Assemblies/WulaFallenEmpire.dll and b/1.6/1.6/Assemblies/WulaFallenEmpire.dll differ diff --git a/1.6/1.6/Defs/MapGeneration/MapGenerator_WULA_PocketSpace_Small.xml b/1.6/1.6/Defs/MapGeneration/MapGenerator_WULA_PocketSpace_Small.xml index 5ac07594..a2472408 100644 --- a/1.6/1.6/Defs/MapGeneration/MapGenerator_WULA_PocketSpace_Small.xml +++ b/1.6/1.6/Defs/MapGeneration/MapGenerator_WULA_PocketSpace_Small.xml @@ -17,7 +17,7 @@
  • Underground_RocksFromGrid
  • Terrain
  • WULA_PocketSpace_Small
  • - +
  • Fog
  • diff --git a/1.6/1.6/Defs/ThingDefs_Buildings/Building_WULA_ArmedShuttleWithPocket.xml b/1.6/1.6/Defs/ThingDefs_Buildings/Building_WULA_ArmedShuttleWithPocket.xml index 21bb662d..4b77b3b7 100644 --- a/1.6/1.6/Defs/ThingDefs_Buildings/Building_WULA_ArmedShuttleWithPocket.xml +++ b/1.6/1.6/Defs/ThingDefs_Buildings/Building_WULA_ArmedShuttleWithPocket.xml @@ -1,9 +1,8 @@ - WULA_ArmedShuttleWithPocket - + An advanced chemfuel-powered shuttle with integrated pocket space technology. Equipped with a defensive turret and internal storage dimension that doesn't require hacking to access. Perfect for long-distance exploration and mobile operations. WulaFallenEmpire.Building_ArmedShuttleWithPocket true @@ -27,28 +26,30 @@ - 6000 - 0.5 - 40000 - 150 - 0.65 + 800 + 0.4 + 60000 + 200 + 0.75 Normal Odyssey - 8 + 10 - 300 - 200 - 8 - 2 + 400 + 300 + 12 + 4 1 + 1 true - 60 - 60 - 5 - 4 + 80 + 90 + 6 + 6 + 1 true true @@ -68,18 +69,30 @@ true
  • ShuttleEngine
  • +
  • VanometricPowerCore
  • - Gun_ChargeBlasterHeavyTurret - 5.5 - 1.75 - (0, 0.05) + Gun_ChargeBlasterAdvancedTurret + 4.5 + 1.0~1.5 + 1.9 + (0, 0.08) + + +
  • + WULA_PocketSpace_Small + WULA_PocketMapExit + (13, 13) + true +
  • +
  • ITab_ContentsTransporter
  • ITab_Shells
  • Shuttles
  • +
  • VoidStructure
  • @@ -121,27 +134,19 @@ true
  • - CompPowerPlant - -400 - true + CompPowerTrader + 200 + false
  • ShuttleIdle_Ambience
  • - -
  • - WULA_PocketSpace_Small - WULA_PocketMapExit - (13, 13) - true -
  • -
  • PlaceWorker_NotUnderRoof
  • PlaceWorker_TurretTop
  • - 2601 + 2602
    @@ -300,15 +305,13 @@ An exit portal that allows return from the pocket space to the main map. WulaFallenEmpire.Building_PocketMapExit - (3,3) + (1,1) MapMeshAndRealTime - Wula/Building/WULA_War_Machine_Recharger - Graphic_Multi - (3,3) + Graphic_Single + Things/Building/Misc/CaveExit/CaveExit + (1,1) - (0,0,0) - Standable 0 @@ -320,11 +323,6 @@
  • UndercaveMapExitLightshafts
  • -
  • - CompPowerPlant - -400 - true -
  • \ No newline at end of file diff --git a/1.6/1.6/Languages/ChineseSimplified/Keyed/WULA_PocketShuttle.xml b/1.6/1.6/Languages/ChineseSimplified/Keyed/WULA_PocketShuttle.xml index 23b9a7eb..0dfffac4 100644 --- a/1.6/1.6/Languages/ChineseSimplified/Keyed/WULA_PocketShuttle.xml +++ b/1.6/1.6/Languages/ChineseSimplified/Keyed/WULA_PocketShuttle.xml @@ -9,15 +9,7 @@ 进入内部空间 - 传送人员到内部空间 进入穿梭机的内部口袋空间。无需骇入即可直接访问。选中的殖民者将被传送到内部空间。 - 创建内部空间 - 创建穿梭机的内部口袋空间。首次使用时需要创建。 - 内部空间创建成功! - 取消进入 - 正在进入... - 查看地图 - 切换到口袋空间地图查看内部情况。 切换到内部空间 直接切换视角到内部口袋空间。适用于已经有殖民者在内部空间时的快速切换。 diff --git a/1.6/1.6/Languages/English/Keyed/WULA_PocketShuttle.xml b/1.6/1.6/Languages/English/Keyed/WULA_PocketShuttle.xml index 5165ca19..22372968 100644 --- a/1.6/1.6/Languages/English/Keyed/WULA_PocketShuttle.xml +++ b/1.6/1.6/Languages/English/Keyed/WULA_PocketShuttle.xml @@ -9,15 +9,7 @@ Enter pocket space - Transport people to pocket space Enter the shuttle's internal pocket space. Direct access without hacking required. Selected colonists will be transported to the internal space. - Create pocket space - Create the shuttle's internal pocket space. Required for first-time use. - Pocket space created successfully! - Cancel enter - Entering... - View map - Switch to pocket space map to view internal conditions. Switch to pocket space Directly switch view to the internal pocket space. Useful for quick switching when colonists are already inside. diff --git a/MCP/vector_cache/knowledge_cache.json b/MCP/vector_cache/knowledge_cache.json index 3a0d95b6..38282d29 100644 --- a/MCP/vector_cache/knowledge_cache.json +++ b/MCP/vector_cache/knowledge_cache.json @@ -2066,5 +2066,3112 @@ ], "result": "--- 结果 1 (相似度: 1.000) ---\n文件路径: C:\\Steam\\steamapps\\common\\RimWorld\\Data\\dll1.6\\Verse\\Verb.txt\n\npublic abstract class Verb : ITargetingSource, IExposable, ILoadReferenceable\n{\n\tpublic VerbProperties verbProps;\n\n\tpublic VerbTracker verbTracker;\n\n\tpublic ManeuverDef maneuver;\n\n\tpublic Tool tool;\n\n\tpublic Thing caster;\n\n\tpublic MechanitorControlGroup controlGroup;\n\n\tpublic string loadID;\n\n\tpublic VerbState state;\n\n\tprotected LocalTargetInfo currentTarget;\n\n\tprotected LocalTargetInfo currentDestination;\n\n\tprotected int burstShotsLeft;\n\n\tprotected int ticksToNextBurstShot;\n\n\tprotected int lastShotTick = -999999;\n\n\tprotected bool surpriseAttack;\n\n\tprotected bool canHitNonTargetPawnsNow = true;\n\n\tpublic bool preventFriendlyFire;\n\n\tprotected bool nonInterruptingSelfCast;\n\n\tpublic Action castCompleteCallback;\n\n\tprivate Texture2D commandIconCached;\n\n\tprivate readonly List> maintainedEffecters = new List>();\n\n\tprivate int? cachedTicksBetweenBurstShots;\n\n\tprivate int? cachedBurstShotCount;\n\n\tprivate static readonly List tempLeanShootSources = new List();\n\n\tprivate static readonly List tempDestList = new List();\n\n\tpublic IVerbOwner DirectOwner => verbTracker.directOwner;\n\n\tpublic ImplementOwnerTypeDef ImplementOwnerType => verbTracker.directOwner.ImplementOwnerTypeDef;\n\n\tpublic CompEquippable EquipmentCompSource => DirectOwner as CompEquippable;\n\n\tpublic CompApparelReloadable ReloadableCompSource => DirectOwner as CompApparelReloadable;\n\n\tpublic CompApparelVerbOwner_Charged VerbOwner_ChargedCompSource => DirectOwner as CompApparelVerbOwner_Charged;\n\n\tpublic ThingWithComps EquipmentSource\n\t{\n\t\tget\n\t\t{\n\t\t\tif (EquipmentCompSource != null)\n\t\t\t{\n\t\t\t\treturn EquipmentCompSource.parent;\n\t\t\t}\n\t\t\tif (ReloadableCompSource != null)\n\t\t\t{\n\t\t\t\treturn ReloadableCompSource.parent;\n\t\t\t}\n\t\t\tif (VerbOwner_ChargedCompSource != null)\n\t\t\t{\n\t\t\t\treturn VerbOwner_ChargedCompSource.parent;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tpublic HediffComp_VerbGiver HediffCompSource => DirectOwner as HediffComp_VerbGiver;\n\n\tpublic Hediff HediffSource\n\t{\n\t\tget\n\t\t{\n\t\t\tif (HediffCompSource == null)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn HediffCompSource.parent;\n\t\t}\n\t}\n\n\tpublic Pawn_MeleeVerbs_TerrainSource TerrainSource => DirectOwner as Pawn_MeleeVerbs_TerrainSource;\n\n\tpublic TerrainDef TerrainDefSource\n\t{\n\t\tget\n\t\t{\n\t\t\tif (TerrainSource == null)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn TerrainSource.def;\n\t\t}\n\t}\n\n\tpublic virtual Thing Caster => caster;\n\n\tpublic virtual Pawn CasterPawn => caster as Pawn;\n\n\tpublic virtual Verb GetVerb => this;\n\n\tpublic virtual bool CasterIsPawn => caster is Pawn;\n\n\tpublic virtual bool Targetable => verbProps.targetable;\n\n\tpublic virtual bool MultiSelect => false;\n\n\tpublic virtual bool HidePawnTooltips => false;\n\n\tpublic LocalTargetInfo CurrentTarget => currentTarget;\n\n\tpublic LocalTargetInfo CurrentDestination => currentDestination;\n\n\tpublic int LastShotTick => lastShotTick;\n\n\tpublic virtual TargetingParameters targetParams => verbProps.targetParams;\n\n\tpublic virtual ITargetingSource DestinationSelector => null;\n\n\tprotected virtual int ShotsPerBurst => 1;\n\n\tpublic virtual Texture2D UIIcon\n\t{\n\t\tget\n\t\t{\n\t\t\tif (verbProps.commandIcon != null)\n\t\t\t{\n\t\t\t\tif (commandIconCached == null)\n\t\t\t\t{\n\t\t\t\t\tcommandIconCached = ContentFinder.Get(verbProps.commandIcon);\n\t\t\t\t}\n\t\t\t\treturn commandIconCached;\n\t\t\t}\n\t\t\tif (EquipmentSource != null)\n\t\t\t{\n\t\t\t\treturn EquipmentSource.def.uiIcon;\n\t\t\t}\n\t\t\treturn BaseContent.BadTex;\n\t\t}\n\t}\n\n\tpublic bool Bursting => burstShotsLeft > 0;\n\n\tpublic virtual bool IsMeleeAttack => verbProps.IsMeleeAttack;\n\n\tpublic bool BuggedAfterLoading => verbProps == null;\n\n\tpublic bool WarmingUp => WarmupStance != null;\n\n\tpublic Stance_Warmup WarmupStance\n\t{\n\t\tget\n\t\t{\n\t\t\tif (CasterPawn == null || !CasterPawn.Spawned)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tif (!(CasterPawn.stances.curStance is Stance_Warmup stance_Warmup) || stance_Warmup.verb != this)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn stance_Warmup;\n\t\t}\n\t}\n\n\tpublic int WarmupTicksLeft\n\t{\n\t\tget\n\t\t{\n\t\t\tif (WarmupStance == null)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\treturn WarmupStance.ticksLeft;\n\t\t}\n\t}\n\n\tpublic float WarmupProgress => 1f - WarmupTicksLeft.TicksToSeconds() / verbProps.warmupTime;\n\n\tpublic virtual string ReportLabel => verbProps.label;\n\n\tpublic virtual float EffectiveRange => verbProps.AdjustedRange(this, Caster);\n\n\tpublic virtual float? AimAngleOverride => null;\n\n\tpublic bool NonInterruptingSelfCast\n\t{\n\t\tget\n\t\t{\n\t\t\tif (!verbProps.nonInterruptingSelfCast)\n\t\t\t{\n\t\t\t\treturn nonInterruptingSelfCast;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t}\n\n\tpublic int TicksBetweenBurstShots\n\t{\n\t\tget\n\t\t{\n\t\t\tif (!cachedTicksBetweenBurstShots.HasValue)\n\t\t\t{\n\t\t\t\tfloat num = verbProps.ticksBetweenBurstShots;\n\t\t\t\tif (EquipmentSource != null && EquipmentSource.TryGetComp(out var comp))\n\t\t\t\t{\n\t\t\t\t\tforeach (WeaponTraitDef item in comp.TraitsListForReading)\n\t\t\t\t\t{\n\t\t\t\t\t\tnum /= item.burstShotSpeedMultiplier;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcachedTicksBetweenBurstShots = Mathf.RoundToInt(num);\n\t\t\t}\n\t\t\treturn cachedTicksBetweenBurstShots.Value;\n\t\t}\n\t}\n\n\tpublic int BurstShotCount\n\t{\n\t\tget\n\t\t{\n\t\t\tif (!cachedBurstShotCount.HasValue)\n\t\t\t{\n\t\t\t\tfloat num = verbProps.burstShotCount;\n\t\t\t\tif (EquipmentSource != null && EquipmentSource.TryGetComp(out var comp))\n\t\t\t\t{\n\t\t\t\t\tforeach (WeaponTraitDef item in comp.TraitsListForReading)\n\t\t\t\t\t{\n\t\t\t\t\t\tnum *= item.burstShotCountMultiplier;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcachedBurstShotCount = Mathf.CeilToInt(num);\n\t\t\t}\n\t\t\treturn cachedBurstShotCount.Value;\n\t\t}\n\t}\n\n\tpublic bool IsStillUsableBy(Pawn pawn)\n\t{\n\t\tif (!Available())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif (!DirectOwner.VerbsStillUsableBy(pawn))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif (verbProps.GetDamageFactorFor(this, pawn) == 0f)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif (pawn.IsSubhuman && verbProps.category == VerbCategory.Ignite)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic virtual bool IsUsableOn(Thing target)\n\t{\n\t\treturn true;\n\t}\n\n\tpublic virtual void ExposeData()\n\t{\n\t\tScribe_Values.Look(ref loadID, \"loadID\");\n\t\tScribe_Values.Look(ref state, \"state\", VerbState.Idle);\n\t\tScribe_TargetInfo.Look(ref currentTarget, \"currentTarget\");\n\t\tScribe_TargetInfo.Look(ref currentDestination, \"currentDestination\");\n\t\tScribe_Values.Look(ref burstShotsLeft, \"burstShotsLeft\", 0);\n\t\tScribe_Values.Look(ref ticksToNextBurstShot, \"ticksToNextBurstShot\", 0);\n\t\tScribe_Values.Look(ref lastShotTick, \"lastShotTick\", 0);\n\t\tScribe_Values.Look(ref surpriseAttack, \"surpriseAttack\", defaultValue: false);\n\t\tScribe_Values.Look(ref canHitNonTargetPawnsNow, \"canHitNonTargetPawnsNow\", defaultValue: false);\n\t\tScribe_Values.Look(ref preventFriendlyFire, \"preventFriendlyFire\", defaultValue: false);\n\t\tScribe_Values.Look(ref nonInterruptingSelfCast, \"nonInterruptingSelfCast\", defaultValue: false);\n\t}\n\n\tpublic string GetUniqueLoadID()\n\t{\n\t\treturn \"Verb_\" + loadID;\n\t}\n\n\tpublic static string CalculateUniqueLoadID(IVerbOwner owner, Tool tool, ManeuverDef maneuver)\n\t{\n\t\treturn string.Format(\"{0}_{1}_{2}\", owner.UniqueVerbOwnerID(), (tool != null) ? tool.id : \"NT\", (maneuver != null) ? maneuver.defName : \"NM\");\n\t}\n\n\tpublic static string CalculateUniqueLoadID(IVerbOwner owner, int index)\n\t{\n\t\treturn $\"{owner.UniqueVerbOwnerID()}_{index}\";\n\t}\n\n\tpublic bool TryStartCastOn(LocalTargetInfo castTarg, bool surpriseAttack = false, bool canHitNonTargetPawns = true, bool preventFriendlyFire = false, bool nonInterruptingSelfCast = false)\n\t{\n\t\treturn TryStartCastOn(castTarg, LocalTargetInfo.Invalid, surpriseAttack, canHitNonTargetPawns, preventFriendlyFire, nonInterruptingSelfCast);\n\t}\n\n\tpublic virtual bool TryStartCastOn(LocalTargetInfo castTarg, LocalTargetInfo destTarg, bool surpriseAttack = false, bool canHitNonTargetPawns = true, bool preventFriendlyFire = false, bool nonInterruptingSelfCast = false)\n\t{\n\t\tif (caster == null)\n\t\t{\n\t\t\tLog.Error(\"Verb \" + GetUniqueLoadID() + \" needs caster to work (possibly lost during saving/loading).\");\n\t\t\treturn false;\n\t\t}\n\t\tif (!caster.Spawned)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif (state == VerbState.Bursting || !CanHitTarget(castTarg))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif (CausesTimeSlowdown(castTarg))\n\t\t{\n\t\t\tFind.TickManager.slower.SignalForceNormalSpeed();\n\t\t}\n\t\tthis.surpriseAttack = surpriseAttack;\n\t\tcanHitNonTargetPawnsNow = canHitNonTargetPawns;\n\t\tthis.preventFriendlyFire = preventFriendlyFire;\n\t\tthis.nonInterruptingSelfCast = nonInterruptingSelfCast;\n\t\tcurrentTarget = castTarg;\n\t\tcurrentDestination = destTarg;\n\t\tif (CasterIsPawn && verbProps.warmupTime > 0f)\n\t\t{\n\t\t\tif (!TryFindShootLineFromTo(caster.Position, castTarg, out var resultingLine))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tCasterPawn.Drawer.Notify_WarmingCastAlongLine(resultingLine, caster.Position);\n\t\t\tfloat statValue = CasterPawn.GetStatValue(StatDefOf.AimingDelayFactor);\n\t\t\tint ticks = (verbProps.warmupTime * statValue).SecondsToTicks();\n\t\t\tCasterPawn.stances.SetStance(new Stance_Warmup(ticks, castTarg, this));\n\t\t\tif (verbProps.stunTargetOnCastStart && castTarg.Pawn != null)\n\t\t\t{\n\t\t\t\tcastTarg.Pawn.stances.stunner.StunFor(ticks, null, addBattleLog: false);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (verbTracker.directOwner is Ability ability)\n\t\t\t{\n\t\t\t\tability.lastCastTick = Find.TickManager.TicksGame;\n\t\t\t}\n\t\t\tWarmupComplete();\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic virtual void WarmupComplete()\n\t{\n\t\tburstShotsLeft = ShotsPerBurst;\n\t\tstate = VerbState.Bursting;\n\t\tTryCastNextBurstShot();\n\t}\n\n\tpublic void VerbTick()\n\t{\n\t\tif (state == VerbState.Bursting)\n\t\t{\n\t\t\tif (!caster.Spawned || (caster is Pawn pawn && pawn.stances.stunner.Stunned))\n\t\t\t{\n\t\t\t\tReset();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tticksToNextBurstShot--;\n\t\t\t\tif (ticksToNextBurstShot <= 0)\n\t\t\t\t{\n\t\t\t\t\tTryCastNextBurstShot();\n\t\t\t\t}\n\t\t\t\tBurstingTick();\n\t\t\t}\n\t\t}\n\t\tfor (int num = maintainedEffecters.Count - 1; num >= 0; num--)\n\t\t{\n\t\t\tEffecter item = maintainedEffecters[num].Item1;\n\t\t\tif (item.ticksLeft > 0)\n\t\t\t{\n\t\t\t\tTargetInfo item2 = maintainedEffecters[num].Item2;\n\t\t\t\tTargetInfo item3 = maintainedEffecters[num].Item3;\n\t\t\t\titem.EffectTick(item2, item3);\n\t\t\t\titem.ticksLeft--;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\titem.Cleanup();\n\t\t\t\tmaintainedEffecters.RemoveAt(num);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic virtual void BurstingTick()\n\t{\n\t}\n\n\tpublic void AddEffecterToMaintain(Effecter eff, IntVec3 pos, int ticks, Map map = null)\n\t{\n\t\teff.ticksLeft = ticks;\n\t\tTargetInfo targetInfo = new TargetInfo(pos, map ?? caster.Map);\n\t\tmaintainedEffecters.Add(new Tuple(eff, targetInfo, targetInfo));\n\t}\n\n\tpublic void AddEffecterToMaintain(Effecter eff, IntVec3 posA, IntVec3 posB, int ticks, Map map = null)\n\t{\n\t\teff.ticksLeft = ticks;\n\t\tTargetInfo item = new TargetInfo(posA, map ?? caster.Map);\n\t\tTargetInfo item2 = new TargetInfo(posB, map ?? caster.Map);\n\t\tmaintainedEffecters.Add(new Tuple(eff, item, item2));\n\t}\n\n\tpublic virtual bool Available()\n\t{\n\t\tif (verbProps.consumeFuelPerShot > 0f)\n\t\t{\n\t\t\tCompRefuelable compRefuelable = caster.TryGetComp();\n\t\t\tif (compRefuelable != null && compRefuelable.Fuel < verbProps.consumeFuelPerShot)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tCompApparelVerbOwner compApparelVerbOwner = EquipmentSource?.GetComp();\n\t\tif (compApparelVerbOwner != null && !compApparelVerbOwner.CanBeUsed(out var reason))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif (CasterIsPawn && EquipmentSource != null && EquipmentUtility.RolePreventsFromUsing(CasterPawn, EquipmentSource, out reason))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\tprotected void TryCastNextBurstShot()\n\t{\n\t\tLocalTargetInfo localTargetInfo = currentTarget;\n\t\tif (Available() && TryCastShot())\n\t\t{\n\t\t\tif (verbProps.muzzleFlashScale > 0.01f)\n\t\t\t{\n\t\t\t\tFleckMaker.Static(caster.Position, caster.Map, FleckDefOf.ShotFlash, verbProps.muzzleFlashScale);\n\t\t\t}\n\t\t\tif (verbProps.soundCast != null)\n\t\t\t{\n\t\t\t\tverbProps.soundCast.PlayOneShot(new TargetInfo(caster.Position, caster.MapHeld));\n\t\t\t}\n\t\t\tif (verbProps.soundCastTail != null)\n\t\t\t{\n\t\t\t\tverbProps.soundCastTail.PlayOneShotOnCamera(caster.Map);\n\t\t\t}\n\t\t\tif (CasterIsPawn)\n\t\t\t{\n\t\t\t\tCasterPawn.Notify_UsedVerb(CasterPawn, this);\n\t\t\t\tif (CasterPawn.thinker != null && localTargetInfo == CasterPawn.mindState.enemyTarget)\n\t\t\t\t{\n\t\t\t\t\tCasterPawn.mindState.Notify_EngagedTarget();\n\t\t\t\t}\n\t\t\t\tif (CasterPawn.mindState != null)\n\t\t\t\t{\n\t\t\t\t\tCasterPawn.mindState.Notify_AttackedTarget(localTargetInfo);\n\t\t\t\t}\n\t\t\t\tif (CasterPawn.MentalState != null)\n\t\t\t\t{\n\t\t\t\t\tCasterPawn.MentalState.Notify_AttackedTarget(localTargetInfo);\n\t\t\t\t}\n\t\t\t\tif (TerrainDefSource != null)\n\t\t\t\t{\n\t\t\t\t\tCasterPawn.meleeVerbs.Notify_UsedTerrainBasedVerb();\n\t\t\t\t}\n\t\t\t\tif (CasterPawn.health != null)\n\t\t\t\t{\n\t\t\t\t\tCasterPawn.health.Notify_UsedVerb(this, localTargetInfo);\n\t\t\t\t}\n\t\t\t\tif (EquipmentSource != null)\n\t\t\t\t{\n\t\t\t\t\tEquipmentSource.Notify_UsedWeapon(CasterPawn);\n\t\t\t\t}\n\t\t\t\tif (!CasterPawn.Spawned)\n\t\t\t\t{\n\t\t\t\t\tReset();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (verbProps.consumeFuelPerShot > 0f)\n\t\t\t{\n\t\t\t\tcaster.TryGetComp()?.ConsumeFuel(verbProps.consumeFuelPerShot);\n\t\t\t}\n\t\t\tburstShotsLeft--;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tburstShotsLeft = 0;\n\t\t}\n\t\tif (burstShotsLeft > 0)\n\t\t{\n\t\t\tticksToNextBurstShot = TicksBetweenBurstShots;\n\t\t\tif (CasterIsPawn && !NonInterruptingSelfCast)\n\t\t\t{\n\t\t\t\tCasterPawn.stances.SetStance(new Stance_Cooldown(TicksBetweenBurstShots + 1, currentTarget, this));\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tstate = VerbState.Idle;\n\t\tif (CasterIsPawn && !NonInterruptingSelfCast)\n\t\t{\n\t\t\tCasterPawn.stances.SetStance(new Stance_Cooldown(verbProps.AdjustedCooldownTicks(this, CasterPawn), currentTarget, this));\n\t\t}\n\t\tif (castCompleteCallback != null)\n\t\t{\n\t\t\tcastCompleteCallback();\n\t\t}\n\t\tif (verbProps.consumeFuelPerBurst > 0f)\n\t\t{\n\t\t\tcaster.TryGetComp()?.ConsumeFuel(verbProps.consumeFuelPerBurst);\n\t\t}\n\t}\n\n\tpublic virtual void OrderForceTarget(LocalTargetInfo target)\n\t{\n\t\tif (verbProps.IsMeleeAttack)\n\t\t{\n\t\t\tJob job = JobMaker.MakeJob(JobDefOf.AttackMelee, target);\n\t\t\tjob.playerForced = true;\n\t\t\tif (target.Thing is Pawn pawn)\n\t\t\t{\n\t\t\t\tjob.killIncappedTarget = pawn.Downed;\n\t\t\t}\n\t\t\tCasterPawn.jobs.TryTakeOrderedJob(job, JobTag.Misc);\n\t\t\treturn;\n\t\t}\n\t\tfloat num = verbProps.EffectiveMinRange(target, CasterPawn);\n\t\tif ((float)CasterPawn.Position.DistanceToSquared(target.Cell) < num * num && CasterPawn.Position.AdjacentTo8WayOrInside(target.Cell))\n\t\t{\n\t\t\tMessages.Message(\"MessageCantShootInMelee\".Translate(), CasterPawn, MessageTypeDefOf.RejectInput, historical: false);\n\t\t\treturn;\n\t\t}\n\t\tJob job2 = JobMaker.MakeJob(verbProps.ai_IsWeapon ? JobDefOf.AttackStatic : JobDefOf.UseVerbOnThing);\n\t\tjob2.verbToUse = this;\n\t\tjob2.targetA = target;\n\t\tjob2.endIfCantShootInMelee = true;\n\t\tCasterPawn.jobs.TryTakeOrderedJob(job2, JobTag.Misc);\n\t}\n\n\tprotected abstract bool TryCastShot();\n\n\tpublic void Notify_PickedUp()\n\t{\n\t\tReset();\n\t}\n\n\tpublic virtual void Reset()\n\t{\n\t\tstate = VerbState.Idle;\n\t\tcurrentTarget = null;\n\t\tcurrentDestination = null;\n\t\tburstShotsLeft = 0;\n\t\tticksToNextBurstShot = 0;\n\t\tcastCompleteCallback = null;\n\t\tsurpriseAttack = false;\n\t\tpreventFriendlyFire = false;\n\t}\n\n\tpublic virtual void Notify_EquipmentLost()\n\t{\n\t\tif (!CasterIsPawn)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\tPawn casterPawn = CasterPawn;\n\t\tif (casterPawn.Spawned)\n\t\t{\n\t\t\tif (casterPawn.stances.curStance is Stance_Warmup stance_Warmup && stance_Warmup.verb == this)\n\t\t\t{\n\t\t\t\tcasterPawn.stances.CancelBusyStanceSoft();\n\t\t\t}\n\t\t\tif (casterPawn.CurJob != null && casterPawn.CurJob.def == JobDefOf.AttackStatic)\n\t\t\t{\n\t\t\t\tcasterPawn.jobs.EndCurrentJob(JobCondition.Incompletable);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic virtual float HighlightFieldRadiusAroundTarget(out bool needLOSToCenter)\n\t{\n\t\tneedLOSToCenter = false;\n\t\treturn 0f;\n\t}\n\n\tprivate bool CausesTimeSlowdown(LocalTargetInfo castTarg)\n\t{\n\t\tif (!verbProps.CausesTimeSlowdown)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif (!castTarg.HasThing)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tThing thing = castTarg.Thing;\n\t\tif (thing.def.category != ThingCategory.Pawn && (thing.def.building == null || !thing.def.building.IsTurret))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tPawn pawn = thing as Pawn;\n\t\tbool flag = pawn?.Downed ?? false;\n\t\tif ((CasterPawn != null && CasterPawn.Faction == Faction.OfPlayer && CasterPawn.IsShambler) || (pawn != null && pawn.Faction == Faction.OfPlayer && pawn.IsShambler))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif (thing.Faction != Faction.OfPlayer || !caster.HostileTo(Faction.OfPlayer))\n\t\t{\n\t\t\tif (caster.Faction == Faction.OfPlayer && thing.HostileTo(Faction.OfPlayer))\n\t\t\t{\n\t\t\t\treturn !flag;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic virtual bool CanHitTarget(LocalTargetInfo targ)\n\t{\n\t\tif (caster == null || !caster.Spawned)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif (targ == caster)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn CanHitTargetFrom(caster.Position, targ);\n\t}\n\n\tpublic virtual bool ValidateTarget(LocalTargetInfo target, bool showMessages = true)\n\t{\n\t\tif (CasterIsPawn && target.Thing is Pawn p && (p.InSameExtraFaction(caster as Pawn, ExtraFactionType.HomeFaction) || p.InSameExtraFaction(caster as Pawn, ExtraFactionType.MiniFaction)))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif (CasterIsPawn && target.Thing is Pawn victim && HistoryEventUtility.IsKillingInnocentAnimal(CasterPawn, victim) && !new HistoryEvent(HistoryEventDefOf.KilledInnocentAnimal, CasterPawn.Named(HistoryEventArgsNames.Doer)).Notify_PawnAboutToDo())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif (CasterIsPawn && target.Thing is Pawn pawn && CasterPawn.Ideo != null && CasterPawn.Ideo.IsVeneratedAnimal(pawn) && !new HistoryEvent(HistoryEventDefOf.HuntedVeneratedAnimal, CasterPawn.Named(HistoryEventArgsNames.Doer)).Notify_PawnAboutToDo())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic virtual void DrawHighlight(LocalTargetInfo target)\n\t{\n\t\tverbProps.DrawRadiusRing(caster.Position, this);\n\t\tif (target.IsValid)\n\t\t{\n\t\t\tGenDraw.DrawTargetHighlight(target);\n\t\t\tDrawHighlightFieldRadiusAroundTarget(target);\n\t\t}\n\t}\n\n\tprotected void DrawHighlightFieldRadiusAroundTarget(LocalTargetInfo target)\n\t{\n\t\tbool needLOSToCenter;\n\t\tfloat num = HighlightFieldRadiusAroundTarget(out needLOSToCenter);\n\t\tif (!(num > 0.2f) || !TryFindShootLineFromTo(caster.Position, target, out var resultingLine))\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\tif (needLOSToCenter)\n\t\t{\n\t\t\tGenExplosion.RenderPredictedAreaOfEffect(resultingLine.Dest, num, verbProps.explosionRadiusRingColor);\n\t\t\treturn;\n\t\t}\n\t\tGenDraw.DrawFieldEdges((from x in GenRadial.RadialCellsAround(resultingLine.Dest, num, useCenter: true)\n\t\t\twhere x.InBounds(Find.CurrentMap)\n\t\t\tselect x).ToList(), verbProps.explosionRadiusRingColor);\n\t}\n\n\tpublic virtual void OnGUI(LocalTargetInfo target)\n\t{\n\t\tTexture2D icon = ((!target.IsValid) ? TexCommand.CannotShoot : ((!(UIIcon != BaseContent.BadTex)) ? TexCommand.Attack : UIIcon));\n\t\tGenUI.DrawMouseAttachment(icon);\n\t}\n\n\tpublic virtual bool CanHitTargetFrom(IntVec3 root, LocalTargetInfo targ)\n\t{\n\t\tif (targ.Thing != null && targ.Thing == caster)\n\t\t{\n\t\t\treturn targetParams.canTargetSelf;\n\t\t}\n\t\tif (targ.Pawn != null && targ.Pawn.IsPsychologicallyInvisible() && caster.HostileTo(targ.Pawn))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif (ApparelPreventsShooting())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tShootLine resultingLine;\n\t\treturn TryFindShootLineFromTo(root, targ, out resultingLine);\n\t}\n\n\tpublic bool ApparelPreventsShooting()\n\t{\n\t\treturn FirstApparelPreventingShooting() != null;\n\t}\n\n\tpublic Apparel FirstApparelPreventingShooting()\n\t{\n\t\tif (CasterIsPawn && CasterPawn.apparel != null)\n\t\t{\n\t\t\tList wornApparel = CasterPawn.apparel.WornApparel;\n\t\t\tfor (int i = 0; i < wornApparel.Count; i++)\n\t\t\t{\n\t\t\t\tif (!wornApparel[i].AllowVerbCast(this))\n\t\t\t\t{\n\t\t\t\t\treturn wornApparel[i];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic bool TryFindShootLineFromTo(IntVec3 root, LocalTargetInfo targ, out ShootLine resultingLine, bool ignoreRange = false)\n\t{\n\t\tif (targ.HasThing && targ.Thing.Map != caster.Map)\n\t\t{\n\t\t\tresultingLine = default(ShootLine);\n\t\t\treturn false;\n\t\t}\n\t\tif (verbProps.IsMeleeAttack || EffectiveRange <= 1.42f)\n\t\t{\n\t\t\tresultingLine = new ShootLine(root, targ.Cell);\n\t\t\treturn ReachabilityImmediate.CanReachImmediate(root, targ, caster.Map, PathEndMode.Touch, null);\n\t\t}\n\t\tCellRect occupiedRect = (targ.HasThing ? targ.Thing.OccupiedRect() : CellRect.SingleCell(targ.Cell));\n\t\tif (!ignoreRange && OutOfRange(root, targ, occupiedRect))\n\t\t{\n\t\t\tresultingLine = new ShootLine(root, targ.Cell);\n\t\t\treturn false;\n\t\t}\n\t\tif (!verbProps.requireLineOfSight)\n\t\t{\n\t\t\tresultingLine = new ShootLine(root, targ.Cell);\n\t\t\treturn true;\n\t\t}\n\t\tIntVec3 goodDest;\n\t\tif (CasterIsPawn)\n\t\t{\n\t\t\tif (CanHitFromCellIgnoringRange(root, targ, out goodDest))\n\t\t\t{\n\t\t\t\tresultingLine = new ShootLine(root, goodDest);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tShootLeanUtility.LeanShootingSourcesFromTo(root, occupiedRect.ClosestCellTo(root), caster.Map, tempLeanShootSources);\n\t\t\tfor (int i = 0; i < tempLeanShootSources.Count; i++)\n\t\t\t{\n\t\t\t\tIntVec3 intVec = tempLeanShootSources[i];\n\t\t\t\tif (CanHitFromCellIgnoringRange(intVec, targ, out goodDest))\n\t\t\t\t{\n\t\t\t\t\tresultingLine = new ShootLine(intVec, goodDest);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tforeach (IntVec3 item in caster.OccupiedRect())\n\t\t\t{\n\t\t\t\tif (CanHitFromCellIgnoringRange(item, targ, out goodDest))\n\t\t\t\t{\n\t\t\t\t\tresultingLine = new ShootLine(item, goodDest);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tresultingLine = new ShootLine(root, targ.Cell);\n\t\treturn false;\n\t}\n\n\tpublic bool OutOfRange(IntVec3 root, LocalTargetInfo targ, CellRect occupiedRect)\n\t{\n\t\tfloat num = verbProps.EffectiveMinRange(targ, caster);\n\t\tfloat num2 = occupiedRect.ClosestDistSquaredTo(root);\n\t\tif (num2 > EffectiveRange * EffectiveRange || num2 < num * num)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate bool CanHitFromCellIgnoringRange(IntVec3 sourceCell, LocalTargetInfo targ, out IntVec3 goodDest)\n\t{\n\t\tif (targ.Thing != null)\n\t\t{\n\t\t\tif (targ.Thing.Map != caster.Map)\n\t\t\t{\n\t\t\t\tgoodDest = IntVec3.Invalid;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tShootLeanUtility.CalcShootableCellsOf(tempDestList, targ.Thing, sourceCell);\n\t\t\tfor (int i = 0; i < tempDestList.Count; i++)\n\t\t\t{\n\t\t\t\tif (CanHitCellFromCellIgnoringRange(sourceCell, tempDestList[i], targ.Thing.def.Fillage == FillCategory.Full))\n\t\t\t\t{\n\t\t\t\t\tgoodDest = tempDestList[i];\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if (CanHitCellFromCellIgnoringRange(sourceCell, targ.Cell))\n\t\t{\n\t\t\tgoodDest = targ.Cell;\n\t\t\treturn true;\n\t\t}\n\t\tgoodDest = IntVec3.Invalid;\n\t\treturn false;\n\t}\n\n\tprivate bool CanHitCellFromCellIgnoringRange(IntVec3 sourceSq, IntVec3 targetLoc, bool includeCorners = false)\n\t{\n\t\tif (verbProps.mustCastOnOpenGround && (!targetLoc.Standable(caster.Map) || caster.Map.thingGrid.CellContains(targetLoc, ThingCategory.Pawn)))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif (verbProps.requireLineOfSight)\n\t\t{\n\t\t\tif (!includeCorners)\n\t\t\t{\n\t\t\t\tif (!GenSight.LineOfSight(sourceSq, targetLoc, caster.Map, skipFirstCell: true))\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (!GenSight.LineOfSightToEdges(sourceSq, targetLoc, caster.Map, skipFirstCell: true))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic override string ToString()\n\t{\n\t\tstring text = ((verbProps == null) ? \"null\" : ((!verbProps.label.NullOrEmpty()) ? verbProps.label : ((HediffCompSource != null) ? HediffCompSource.Def.label : ((EquipmentSource != null) ? EquipmentSource.def.label : ((verbProps.AdjustedLinkedBodyPartsGroup(tool) == null) ? \"unknown\" : verbProps.AdjustedLinkedBodyPartsGroup(tool).defName)))));\n\t\tif (tool != null)\n\t\t{\n\t\t\ttext = text + \"/\" + loadID;\n\t\t}\n\t\treturn $\"{GetType()}({text})\";\n\t}\n}\n\n", "timestamp": "2025-08-22 19:48:28,843" + }, + "Game-deactivate-map-remove": { + "keywords": [ + "Game", + "remove", + "deactivate", + "map" + ], + "question": "Game method to remove or deactivate map", + "embedding": [ + 0.01010276097804308, + 0.04111691564321518, + 0.04461685195565224, + -0.02886713296175003, + 0.013801224529743195, + 0.0027187014929950237, + 0.035852301865816116, + 0.004981528967618942, + 0.02548483945429325, + 0.07429279386997223, + -0.010308640077710152, + -0.02255842089653015, + -0.0016626542201265693, + -0.044087450951337814, + -0.014007103629410267, + 0.07705745100975037, + -0.02239665947854519, + -0.09217482805252075, + -0.04320511221885681, + 0.030264167115092278, + -0.0046690343879163265, + 0.00877190288156271, + 0.0016488677356392145, + -0.016955580562353134, + -0.05417550727725029, + -0.044440384954214096, + 0.04485214129090309, + 0.0741751492023468, + -0.02404368855059147, + 0.0012398676481097937, + 0.03938165307044983, + -0.015926187857985497, + 0.03323470056056976, + -0.03444056212902069, + 0.05488137528300285, + 0.039881642907857895, + -0.047557976096868515, + 0.0025440724566578865, + 0.0316464938223362, + 0.028573021292686462, + -0.04741092026233673, + 0.00025367195485159755, + -0.010043938644230366, + 0.024146629497408867, + 0.017014402896165848, + 0.02604365348815918, + 0.03352881595492363, + -0.07782214134931564, + -0.038793426007032394, + -0.00936012715101242, + 0.003926400560885668, + 0.030675923451781273, + 0.0277642123401165, + -0.015867363661527634, + 0.01356593519449234, + 0.040352221578359604, + 0.011220388114452362, + -0.01238213200122118, + -0.04288158938288689, + 0.005411668214946985, + 0.020058466121554375, + 0.019396713003516197, + -0.014970321208238602, + -0.002266503870487213, + 0.029822997748851776, + -0.032764121890068054, + -0.026278944686055183, + -0.03664640709757805, + -0.008720433339476585, + -0.02264665625989437, + 0.021705495193600655, + -0.00044783210614696145, + 0.015735013410449028, + -0.014676209539175034, + -0.020131994038820267, + -0.0227643009275198, + -0.027734799310564995, + -0.011985080316662788, + 0.011521853506565094, + -0.015661485493183136, + -0.01872025430202484, + 0.015146789140999317, + -0.014985027723014355, + 0.03655817359685898, + -0.009124837815761566, + 0.035205256193876266, + 0.03655817359685898, + 0.0032683240715414286, + -0.02539660595357418, + 0.06717527657747269, + -0.006963111460208893, + -0.0019595238845795393, + -0.005496225785464048, + -0.014029162004590034, + -0.003867578227072954, + -0.03544054552912712, + -0.026440706104040146, + -0.008014563471078873, + 0.00831602793186903, + 0.020396696403622627, + 0.0045771244913339615, + -0.039234597235918045, + 0.000669105735141784, + 0.05849895998835564, + -0.005992540158331394, + 0.03846990317106247, + -0.030175933614373207, + 0.012411544099450111, + -0.008499848656356335, + -0.006010922137647867, + -0.013779166154563427, + -0.04249924421310425, + -0.017117341980338097, + 0.020881980657577515, + -0.005371227860450745, + 0.028367141261696815, + 0.04129338264465332, + -0.0033492050133645535, + -0.03938165307044983, + 0.010404226370155811, + 0.048646192997694016, + -0.03699934110045433, + -0.02702893130481243, + -0.0349111445248127, + 0.013418878428637981, + -0.02138197235763073, + 0.028705371543765068, + -0.0007242517895065248, + -0.024426035583019257, + -0.01616147719323635, + -0.00188967224676162, + -0.0023731195833534002, + -0.028940660879015923, + 0.010058644227683544, + -0.07723391801118851, + -0.006213124841451645, + -0.005422697402536869, + -0.03670522943139076, + -0.04429332911968231, + 0.046910930424928665, + -0.0006314225611276925, + -0.00188967224676162, + -0.013367408886551857, + -0.0191908348351717, + 0.08382203429937363, + -0.01022775936871767, + -0.07399868220090866, + 0.014455624856054783, + -0.015926187857985497, + -0.004738886374980211, + 0.01973494328558445, + -0.023881927132606506, + -0.019749648869037628, + 0.03070533648133278, + -0.016955580562353134, + -0.004209483973681927, + -0.0048932950012385845, + -0.06805761158466339, + 0.013286528177559376, + -0.026102475821971893, + -0.009249835275113583, + -0.0033436904195696115, + -0.043705105781555176, + -0.00917630735784769, + 0.03670522943139076, + 0.010293934494256973, + -0.019249657168984413, + 0.03799932450056076, + -0.035028789192438126, + -0.03429350629448891, + -0.008139560930430889, + 0.03358763828873634, + -0.041705138981342316, + 0.04623446986079216, + 0.04835208132863045, + -0.027881857007741928, + 0.011661557480692863, + 0.05776367709040642, + -0.02045551873743534, + -0.05988128483295441, + 0.0754692479968071, + 0.021499617025256157, + 0.09599828720092773, + -0.01745557226240635, + -0.011190976947546005, + -0.03161708265542984, + 0.013293880969285965, + 0.10029233247041702, + -0.0032867062836885452, + 0.019337890669703484, + -0.03188178688287735, + 0.04979323223233223, + 0.029720058664679527, + 0.006705762818455696, + -0.028117146342992783, + -0.04094044864177704, + -0.0035367016680538654, + 0.005356522276997566, + -0.015293844975531101, + 0.007349133957177401, + 0.008793961256742477, + 0.03185237571597099, + 0.039616942405700684, + -0.02511719986796379, + -0.0016001553740352392, + -0.023587815463542938, + -0.009014545008540154, + -0.03079356998205185, + 0.028925955295562744, + -0.015146789140999317, + 0.07617511600255966, + 0.009198365733027458, + 0.005014616530388594, + -0.015396784991025925, + -0.011279210448265076, + -0.013940928503870964, + -0.019690826535224915, + -0.018661431968212128, + -0.01357328798621893, + 0.006341798696666956, + 0.005150643642991781, + 0.022043725475668907, + 0.026470117270946503, + 0.006091803312301636, + 0.03899930417537689, + -0.03826402500271797, + 0.044999197125434875, + 0.008205736055970192, + 0.021073153242468834, + 0.07052815705537796, + 0.011227740906178951, + -0.0010716720717027783, + 0.0227643009275198, + -0.02367604896426201, + -0.012088020332157612, + -0.0035017759073525667, + -0.022779006510972977, + -0.004834472667425871, + -0.008896900340914726, + 0.048646192997694016, + 0.010110113769769669, + 0.04955793917179108, + -0.016382060945034027, + 0.04732268676161766, + -0.01972023770213127, + -0.061704784631729126, + -0.025631897151470184, + -0.002301429631188512, + 0.026543645188212395, + -0.0016415149439126253, + 0.025014260783791542, + 0.0334111712872982, + 0.0022922386415302753, + -0.05035204440355301, + 0.018205558881163597, + 0.005238877143710852, + 0.005106526892632246, + -0.014426213689148426, + 0.044646263122558594, + -0.046175647526979446, + -0.0033933219965547323, + 0.015132083557546139, + -0.040616922080516815, + 0.05305787920951843, + -0.05994011089205742, + 0.022617245092988014, + -0.008301322348415852, + 0.026249531656503677, + -0.048734426498413086, + -0.08358674496412277, + 0.004459479358047247, + 0.0045771244913339615, + 0.017205575481057167, + -0.011485089547932148, + -0.017058519646525383, + 0.012999768368899822, + 0.01635264977812767, + 0.0372934527695179, + 0.0010330697987228632, + -0.03664640709757805, + -0.029278891161084175, + 0.010676280595362186, + 0.0239554550498724, + -0.016955580562353134, + 0.037616975605487823, + 0.04985205456614494, + 0.04264630004763603, + -0.013176236301660538, + -0.004768297541886568, + 0.02476426400244236, + -0.0028124498203396797, + 0.015514429658651352, + -0.004110220819711685, + 0.02111727185547352, + -0.00584548432379961, + -0.007801331579685211, + -0.06323416531085968, + 0.052763767540454865, + -0.0237495768815279, + -0.012499777600169182, + -0.024970144033432007, + -0.00959541741758585, + 0.01636735536158085, + 0.011948316358029842, + 0.06917523592710495, + -0.04446979612112045, + -0.025970125570893288, + -0.08552788943052292, + 0.036499351263046265, + -0.07235164940357208, + 0.025293666869401932, + 0.014815912581980228, + -0.043352168053388596, + 0.0015606340020895004, + -0.018617315217852592, + 0.019132012501358986, + -0.04141102731227875, + 0.006396945100277662, + 1.3176178072171751e-05, + 0.0420580729842186, + -0.011749790981411934, + -0.04523449018597603, + -0.0466168187558651, + 0.0050072637386620045, + 0.008918958716094494, + -0.03826402500271797, + 0.02247018739581108, + 0.017984973266720772, + -0.003608391620218754, + -0.032764121890068054, + 0.0008487900486215949, + 0.014815912581980228, + -0.04011693224310875, + -0.014962968416512012, + -0.055528424680233, + 0.0007311450899578631, + 0.01023511216044426, + -0.03352881595492363, + 0.02074963040649891, + -0.007062374148517847, + -0.007316046394407749, + -0.028278907760977745, + -0.031293559819459915, + 0.020352579653263092, + 0.019411418586969376, + 0.02613188698887825, + 0.006069744937121868, + 0.01901436783373356, + 0.04785208776593208, + 0.013874753378331661, + -0.030999448150396347, + 0.014521799981594086, + 0.005275641568005085, + 0.01644088327884674, + 0.02294076792895794, + -0.06905759125947952, + -0.01598501019179821, + -0.005349169485270977, + -0.0602930448949337, + 0.009382185526192188, + -0.006981493439525366, + 0.03191119804978371, + -0.006301358342170715, + 0.0557343028485775, + 0.05852837115526199, + -0.005555048119276762, + 0.01599971577525139, + 0.04082280397415161, + 0.025558369234204292, + 0.008433673530817032, + 0.0033933219965547323, + -0.04820502549409866, + 0.06276358664035797, + 0.027014225721359253, + -0.04649917036294937, + 0.08605729043483734, + 0.032205309718847275, + -0.016014421358704567, + -0.0035128050949424505, + 0.006080774124711752, + 0.015279139392077923, + 0.03044063411653042, + -0.03496996685862541, + -0.09611593186855316, + -0.010014527477324009, + -0.017779095098376274, + -0.01964670978486538, + 0.0026856139302253723, + 0.02704363688826561, + -0.058793071657419205, + 0.05555783584713936, + 0.005374904256314039, + -0.01745557226240635, + -0.011602734215557575, + -0.03829343616962433, + 0.0063638570718467236, + -0.01891142874956131, + 0.06911641359329224, + -0.01342623122036457, + -0.01717616431415081, + -0.02420545183122158, + -0.006444738246500492, + 0.005492549389600754, + -0.02648482285439968, + 0.03299941122531891, + 0.013786518946290016, + 0.053851980715990067, + -0.04732268676161766, + -0.025631897151470184, + -0.02238195389509201, + -0.02467603050172329, + -0.013462995178997517, + -0.0059153358452022076, + 0.06970464438199997, + -0.051204971969127655, + -0.01617618277668953, + 0.005466814618557692, + -0.002145182341337204, + 0.015161494724452496, + 0.058146022260189056, + 0.0031543555669486523, + 0.01608794927597046, + -0.06364592909812927, + -0.004698445554822683, + -0.03355822712182999, + 0.03185237571597099, + 0.07558689266443253, + 0.0034080275800079107, + -0.0016727643087506294, + 0.05964599549770355, + 0.012654186226427555, + -0.00876455008983612, + -0.02476426400244236, + 0.07205753773450851, + -0.001085458556190133, + -0.04067574441432953, + 0.0037058163434267044, + -0.04202866181731224, + -0.025440722703933716, + 0.004345510620623827, + -0.017382042482495308, + -0.00714693171903491, + -0.03464644029736519, + -0.010477754287421703, + -0.030175933614373207, + -0.021676084026694298, + 0.04441097378730774, + -0.010065997019410133, + 0.04146984964609146, + 0.0368816964328289, + 0.009352774359285831, + -0.004007281735539436, + 0.010985098779201508, + 0.012396838515996933, + -0.012977709993720055, + 0.032675888389348984, + -0.00735648674890399, + -0.0732928141951561, + -0.08088091015815735, + -0.005128585267812014, + 0.08029268682003021, + 0.01772027276456356, + -0.018926134333014488, + 0.022411365061998367, + 0.005768279545009136, + 0.018661431968212128, + -0.03982282057404518, + -0.017749683931469917, + -0.013029179535806179, + -0.04211689531803131, + -0.02127903327345848, + 0.037146396934986115, + 0.048381492495536804, + -0.06264594197273254, + 0.05726368725299835, + -0.052057895809412, + -0.026426000520586967, + 0.07176342606544495, + 0.008720433339476585, + 0.0243966244161129, + -0.008418967947363853, + 0.0008648742805235088, + -0.025249550119042397, + -0.0498814657330513, + -0.05938129499554634, + -0.05855778232216835, + 0.007926329039037228, + -0.014418860897421837, + 0.035969946533441544, + 0.003178252140060067, + -0.029175950214266777, + -0.03626406192779541, + 0.006180036813020706, + -0.013315939344465733, + -0.022440776228904724, + 0.037852268666028976, + 0.0019668766763061285, + -0.07752802968025208, + -0.012911534868180752, + -0.02157314494252205, + -0.0007853720453567803, + 0.03855813667178154, + -0.03864637017250061, + -0.02074963040649891, + 0.046734463423490524, + -0.006349151488393545, + -0.04670505225658417, + -0.0169114638119936, + -0.03952870890498161, + -0.01624971069395542, + 0.0030128140933811665, + -0.041528671979904175, + 0.0004354242410045117, + 0.037234630435705185, + -0.0033179556485265493, + 0.008617493323981762, + -0.0004774731060024351, + 0.09376303851604462, + -0.00909542664885521, + 0.003885960206389427, + 0.008080738596618176, + -0.019352596253156662, + -0.013587993569672108, + -2.6539049940765835e-05, + -0.04685210809111595, + -0.020808452740311623, + -0.003340014023706317, + 0.010161583311855793, + -0.010911569930613041, + -0.029073011130094528, + -0.030381811782717705, + 0.015007086098194122, + -0.01292624045163393, + 0.01238948479294777, + -0.0005666259676218033, + 0.01764674484729767, + 0.007632216904312372, + -0.007771920412778854, + 0.03779344633221626, + -0.024455446749925613, + -0.019220246002078056, + -0.004588153678923845, + -0.01406592596322298, + -0.012676244601607323, + 0.02467603050172329, + 0.045087430626153946, + 0.01847025938332081, + 0.026734817773103714, + -0.01470562070608139, + -0.0841161459684372, + 0.027470098808407784, + 0.001457694685086608, + 0.02392604388296604, + -0.0589989498257637, + 0.002397016156464815, + -0.004676387179642916, + 0.018411437049508095, + 0.02438191883265972, + 0.029175950214266777, + 0.0219113752245903, + 0.005547695327550173, + -0.014676209539175034, + -0.0162644162774086, + -0.03052886761724949, + -0.020514341071248055, + -0.02876419387757778, + -0.029999466612935066, + -0.0003568410756997764, + -0.029646530747413635, + -0.017587922513484955, + -0.07688098400831223, + 0.0219113752245903, + -0.019793765619397163, + -0.0032389129046350718, + 0.021779023110866547, + 0.030175933614373207, + 0.03079356998205185, + 0.01502914447337389, + 0.05405786260962486, + 0.03214648738503456, + 0.014080631546676159, + 0.03944047540426254, + -0.024617208167910576, + -0.05841072276234627, + -0.02492602728307247, + -0.01708793081343174, + 0.03188178688287735, + 0.016043832525610924, + 0.0006916237180121243, + 0.0024981172755360603, + 0.06182242929935455, + -0.020440813153982162, + -0.05776367709040642, + -0.02367604896426201, + -0.033028822392225266, + 0.048646192997694016, + 0.018426142632961273, + 0.02467603050172329, + 0.0002961803984362632, + 0.07682216167449951, + -0.030117111280560493, + -0.04405803978443146, + -0.0107351029291749, + -0.008838078007102013, + -0.010499812662601471, + 0.01863202080130577, + 0.017705567181110382, + -0.009220424108207226, + 0.028175968676805496, + 0.012896829284727573, + -0.037764035165309906, + 0.042616888880729675, + -0.017220281064510345, + -0.011918905191123486, + -0.0169114638119936, + -0.02301429584622383, + 0.01219831220805645, + 0.00894836988300085, + -0.009926293976604939, + 0.005110203288495541, + -8.375310426345095e-05, + -0.016470294445753098, + -0.01964670978486538, + -0.024014277383685112, + -0.014837970957159996, + 0.011911552399396896, + -0.0011810451978817582, + -0.010654222220182419, + 0.041705138981342316, + -0.01063951663672924, + 0.043175701051950455, + -0.011088037863373756, + -0.019852587953209877, + 0.038322847336530685, + 0.04870501533150673, + -0.025911303237080574, + -0.0016865507932379842, + 0.00014475845091510564, + 0.007992505095899105, + -0.01238213200122118, + 0.0006553191924467683, + 0.005404315423220396, + -0.009963057935237885, + 0.005341816693544388, + 0.009448361583054066, + -0.0044080098159611225, + -0.001861180062405765, + 0.0023345171939581633, + 0.010705691762268543, + 0.013382114470005035, + 0.003930076956748962, + 0.06752821058034897, + 0.002564292633906007, + 0.015661485493183136, + -0.027293631806969643, + 0.0016470295377075672, + -0.024014277383685112, + -0.03629347309470177, + 0.013374761678278446, + -0.041263971477746964, + -0.054969608783721924, + -0.08052797615528107, + -0.011257152073085308, + -0.01097039319574833, + -0.03135238215327263, + 0.011757143773138523, + 0.0041837492026388645, + 0.014904146082699299, + 0.006735173985362053, + 0.025190727785229683, + -0.03999928757548332, + -0.011418914422392845, + -0.023602521046996117, + 0.0028731105849146843, + 0.033940572291612625, + 0.012985062785446644, + -0.026058359071612358, + -0.05191083997488022, + 0.032675888389348984, + 0.0022793712560087442, + 0.03638170659542084, + 0.049381472170352936, + -0.025264255702495575, + -0.01929377391934395, + -0.04896971583366394, + -0.00609547970816493, + 0.018867311999201775, + -0.005782985128462315, + -0.0013896811287850142, + 0.03882283717393875, + 0.008051327429711819, + -0.029984761029481888, + 0.045175667852163315, + -0.0019668766763061285, + -0.01782321184873581, + -0.02694069594144821, + 0.003591847838833928, + -0.043087467551231384, + 0.052028484642505646, + 0.039499297738075256, + -0.019220246002078056, + -0.04555801302194595, + -0.06676352024078369, + -0.016734996810555458, + 0.02392604388296604, + -0.007882212288677692, + -0.0021764319390058517, + -0.013668874278664589, + -0.0015275463229045272, + 0.008205736055970192, + 0.010632163845002651, + -0.016882052645087242, + -0.013315939344465733, + -0.005768279545009136, + -0.004264629911631346, + 0.008551318198442459, + 0.040058109909296036, + -0.01479385420680046, + -0.024190746247768402, + -0.012183606624603271, + 0.001329939579591155, + 0.009713062085211277, + -0.009933646768331528, + 0.02238195389509201, + -0.021779023110866547, + 0.025734836235642433, + 0.001751807052642107, + -0.012249781750142574, + -0.02411721833050251, + 0.04291100054979324, + -0.03444056212902069, + -0.012360073626041412, + -0.04123456031084061, + -0.0020992273930460215, + 0.019426124170422554, + -0.012477719224989414, + 0.03317587822675705, + -0.02777891792356968, + 0.007617511320859194, + -0.06399886310100555, + -0.07876330614089966, + -0.03258765488862991, + 0.06711645424365997, + -0.00370213994756341, + 0.09829236567020416, + -0.02958770841360092, + -0.018617315217852592, + 0.028528904542326927, + 0.004834472667425871, + -0.00751089584082365, + 0.006018275395035744, + 0.0035642748698592186, + 0.07452808320522308, + -0.017249692231416702, + 0.007154284510761499, + 0.016220299527049065, + 0.055528424680233, + 0.05817543342709541, + 0.013058590702712536, + -0.012845359742641449, + 0.009286599233746529, + 0.01607324369251728, + 0.004360216669738293, + 0.01682323031127453, + -0.04761679843068123, + 0.05949893966317177, + 0.03635229542851448, + 0.03917577117681503, + -0.054763730615377426, + -0.0064226798713207245, + -0.02492602728307247, + -0.009566006250679493, + 0.03867578133940697, + 0.03455820679664612, + -0.01663205586373806, + 0.05108732730150223, + 0.008720433339476585, + 0.0016589778242632747, + 0.04732268676161766, + -0.004474184941500425, + 0.05932247266173363, + 0.02001434937119484, + 0.0498814657330513, + 0.02045551873743534, + 0.013860046863555908, + 0.01462473999708891, + 0.0072645763866603374, + -0.012786537408828735, + -0.013051237910985947, + -0.01791144534945488, + -0.004816090688109398, + -0.005187407601624727, + 0.09141013771295547, + -0.01844084821641445, + -0.02658776193857193, + -0.015852658078074455, + 0.025073083117604256, + 0.09705709666013718, + -0.011602734215557575, + -0.014212981797754765, + -0.024073101580142975, + -0.08082208782434464, + 0.01041893195360899, + 0.00377934449352324, + -0.007617511320859194, + 0.033852338790893555, + -0.015573251992464066, + 0.03894048184156418, + -0.00040417478885501623, + -0.032205309718847275, + -0.031940609216690063, + 0.022411365061998367, + 0.04058751091361046, + 0.024161335080862045, + -0.02813185192644596, + -0.023984866216778755, + -0.052469652146101, + 0.005838131532073021, + -0.02969064749777317, + 0.0005179135478101671, + -0.0027977442368865013, + -0.0015247890260070562, + 0.012801242992281914, + 0.005782985128462315, + 0.009955705143511295, + -0.02064669132232666, + -0.006091803312301636, + 0.026087770238518715, + 0.015014438889920712, + -0.032940588891506195, + 0.03588171303272247, + -0.0063087111338973045, + -0.015051202848553658, + 0.025455428287386894, + 0.030028877779841423, + 0.03488173335790634, + -0.027323042973876, + -0.02019081637263298, + -0.045734480023384094, + 0.020220227539539337, + -0.012948298826813698, + -0.05588135868310928, + 0.012132137082517147, + -0.039793409407138824, + 0.0070219337940216064, + -0.015426196157932281, + 0.025705425068736076, + -0.03323470056056976, + 0.0015073261456564069, + 0.018690843135118484, + -0.04094044864177704, + -0.019440829753875732, + 0.019205540418624878, + -0.01680852472782135, + -0.009316010400652885, + 0.0698222890496254, + 0.03170531615614891, + 0.017690861597657204, + 0.0027995824348181486, + 0.04158749431371689, + -0.00895572267472744, + -0.037058163434267044, + -0.02322017401456833, + 0.02522013895213604, + 0.021234916523098946, + -0.0231025293469429, + 0.04961676523089409, + -0.0007063293596729636, + 0.0030514162499457598, + 0.019337890669703484, + 0.009573359042406082, + 0.00021897588158026338, + -0.0002449404855724424, + 0.03391116112470627, + 0.022087842226028442, + -0.04394039511680603, + -0.027117164805531502, + 0.016146771609783173, + 0.01064686942845583, + -0.010624811053276062, + 0.0008400585502386093, + -0.022587833926081657, + -0.0035955242346972227, + -0.004926383029669523, + 0.024176040664315224, + 0.01219095941632986, + 0.008845430798828602, + 0.009668945334851742, + -0.02641129493713379, + 0.022043725475668907, + 0.04211689531803131, + -0.0338229276239872, + 0.014470330439507961, + -0.011124801822006702, + 0.005959452595561743, + 0.011639498174190521, + -0.031470026820898056, + -0.001660816022194922, + 0.013235058635473251, + -0.01147038396447897, + 0.015396784991025925, + -0.054675497114658356, + 0.04485214129090309, + -0.010360109619796276, + 0.010889511555433273, + -0.07323399186134338, + 0.019161423668265343, + -0.007580747362226248, + 0.00041014893213286996, + -0.026381883770227432, + 0.01197037473320961, + 0.02248489297926426, + 0.0036139062140136957, + 0.0033124410547316074, + 0.022146664559841156, + -0.06394004076719284, + -0.017117341980338097, + 0.04585212469100952, + 0.021823139861226082, + 0.001150714815594256, + 0.029822997748851776, + -0.014146806672215462, + 0.008588082157075405, + 0.023528993129730225, + 0.01311741303652525, + -0.0156173687428236, + -0.036234647035598755, + -0.03279353305697441, + 0.028278907760977745, + -0.026720112189650536, + -0.019779060035943985, + 0.044263917952775955, + 0.021308444440364838, + -0.033028822392225266, + -0.008926311507821083, + 0.03655817359685898, + -0.03994046524167061, + -0.04220513254404068, + -0.04679328575730324, + -0.031028859317302704, + 0.002766494872048497, + -0.03399939462542534, + 0.03435232862830162, + 0.0071138436906039715, + 0.00781603716313839, + 0.019073190167546272, + 0.001996288076043129, + 0.012779184617102146, + 0.018396731466054916, + -0.02347017079591751, + -0.02411721833050251, + 0.009713062085211277, + 0.049293238669633865, + -0.07141049206256866, + 0.012970357201993465, + 0.032028842717409134, + 0.008668962866067886, + 0.035969946533441544, + -0.012146842665970325, + -0.030117111280560493, + 0.035587601363658905, + 0.03602876886725426, + 0.025278961285948753, + -0.04761679843068123, + 0.009124837815761566, + -0.009646886959671974, + 0.028367141261696815, + 0.01416151225566864, + -0.007771920412778854, + 0.0392640084028244, + 0.01563207432627678, + 0.0015257081249728799, + 0.00803662184625864, + -0.05482255294919014, + -0.011485089547932148, + -0.022690773010253906, + -0.031293559819459915, + -0.04008752107620239, + -0.07988093048334122, + -0.07470455020666122, + -0.004584477283060551, + 0.004779326729476452, + -0.0015367373125627637, + -0.004003605339676142, + 0.01717616431415081, + -0.07811625301837921, + -0.022602539509534836, + -0.015323256142437458, + 0.033293526619672775, + 0.002064301399514079, + 0.009551300667226315, + -0.03132297098636627, + 0.03702875226736069, + 0.03464644029736519, + 0.03052886761724949, + -0.03999928757548332, + -0.032293543219566345, + -0.01964670978486538, + 0.01889672316610813, + 0.013808577321469784, + 0.011073332279920578, + 0.030293578281998634, + -0.001751807052642107, + -0.036969929933547974, + 0.00525358272716403, + 0.03217589855194092, + -0.025720130652189255, + 0.002490764483809471, + -0.027073048055171967, + -0.029955347999930382, + 0.0641753301024437, + 0.008705727756023407, + 0.04064633324742317, + 0.013712991029024124, + 0.03496996685862541, + 0.027558332309126854, + -0.041058093309402466, + 0.005260935518890619, + 0.0010431800037622452, + -0.03517584502696991, + 0.022176075726747513, + 0.0041837492026388645, + 0.03179354965686798, + -0.0016644924180582166 + ], + "result": "--- 结果 1 (相似度: 1.000) ---\n文件路径: C:\\Steam\\steamapps\\common\\RimWorld\\Data\\dll1.6\\Verse\\Game.txt\n\npublic class Game : IExposable, IDisposable\n{\n\tprivate GameInitData initData;\n\n\tprivate Gravship gravshipInt;\n\n\tpublic sbyte currentMapIndex = -1;\n\n\tprivate GameInfo info = new GameInfo();\n\n\tpublic List components = new List();\n\n\tprivate GameRules rules = new GameRules();\n\n\tprivate Scenario scenarioInt;\n\n\tprivate World worldInt;\n\n\tprivate List maps = new List();\n\n\tpublic PlaySettings playSettings = new PlaySettings();\n\n\tpublic StoryWatcher storyWatcher = new StoryWatcher();\n\n\tpublic LetterStack letterStack = new LetterStack();\n\n\tpublic ResearchManager researchManager = new ResearchManager();\n\n\tpublic AnalysisManager analysisManager = new AnalysisManager();\n\n\tpublic GameEnder gameEnder = new GameEnder();\n\n\tpublic Storyteller storyteller = new Storyteller();\n\n\tpublic History history = new History();\n\n\tpublic TaleManager taleManager = new TaleManager();\n\n\tpublic PlayLog playLog = new PlayLog();\n\n\tpublic BattleLog battleLog = new BattleLog();\n\n\tpublic OutfitDatabase outfitDatabase = new OutfitDatabase();\n\n\tpublic DrugPolicyDatabase drugPolicyDatabase = new DrugPolicyDatabase();\n\n\tpublic ReadingPolicyDatabase readingPolicyDatabase = new ReadingPolicyDatabase();\n\n\tpublic FoodRestrictionDatabase foodRestrictionDatabase = new FoodRestrictionDatabase();\n\n\tpublic TickManager tickManager = new TickManager();\n\n\tpublic Tutor tutor = new Tutor();\n\n\tpublic Autosaver autosaver = new Autosaver();\n\n\tpublic DateNotifier dateNotifier = new DateNotifier();\n\n\tpublic SignalManager signalManager = new SignalManager();\n\n\tpublic UniqueIDsManager uniqueIDsManager = new UniqueIDsManager();\n\n\tpublic QuestManager questManager = new QuestManager();\n\n\tpublic TransportShipManager transportShipManager = new TransportShipManager();\n\n\tpublic StudyManager studyManager = new StudyManager();\n\n\tpublic CustomXenogermDatabase customXenogermDatabase = new CustomXenogermDatabase();\n\n\tpublic CustomXenotypeDatabase customXenotypeDatabase = new CustomXenotypeDatabase();\n\n\tpublic RelationshipRecords relationshipRecords = new RelationshipRecords();\n\n\tpublic HiddenItemsManager hiddenItemsManager = new HiddenItemsManager();\n\n\tpublic EntityCodex entityCodex = new EntityCodex();\n\n\tprivate static readonly List tmpPlayerHomeMaps = new List();\n\n\tpublic Scenario Scenario\n\t{\n\t\tget\n\t\t{\n\t\t\treturn scenarioInt;\n\t\t}\n\t\tset\n\t\t{\n\t\t\tscenarioInt = value;\n\t\t}\n\t}\n\n\tpublic World World\n\t{\n\t\tget\n\t\t{\n\t\t\treturn worldInt;\n\t\t}\n\t\tset\n\t\t{\n\t\t\tif (worldInt != value)\n\t\t\t{\n\t\t\t\tworldInt = value;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic Map CurrentMap\n\t{\n\t\tget\n\t\t{\n\t\t\tif (currentMapIndex < 0)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn maps[currentMapIndex];\n\t\t}\n\t\tset\n\t\t{\n\t\t\tint num;\n\t\t\tif (value == null)\n\t\t\t{\n\t\t\t\tnum = -1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tnum = maps.IndexOf(value);\n\t\t\t\tif (num < 0)\n\t\t\t\t{\n\t\t\t\t\tLog.Error(\"Could not set current map because it does not exist.\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (currentMapIndex != num)\n\t\t\t{\n\t\t\t\tcurrentMapIndex = (sbyte)num;\n\t\t\t\tFind.MapUI.Notify_SwitchedMap();\n\t\t\t\tAmbientSoundManager.Notify_SwitchedMap();\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic Map AnyPlayerHomeMap\n\t{\n\t\tget\n\t\t{\n\t\t\tif (Faction.OfPlayerSilentFail == null)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tfor (int i = 0; i < maps.Count; i++)\n\t\t\t{\n\t\t\t\tif (maps[i].IsPlayerHome)\n\t\t\t\t{\n\t\t\t\t\treturn maps[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (ModsConfig.OdysseyActive)\n\t\t\t{\n\t\t\t\tfor (int j = 0; j < maps.Count; j++)\n\t\t\t\t{\n\t\t\t\t\tif (GravshipUtility.PlayerHasGravEngine(maps[j]))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn maps[j];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tpublic bool PlayerHasControl\n\t{\n\t\tget\n\t\t{\n\t\t\tif (ScreenFader.IsFading())\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (WorldComponent_GravshipController.CutsceneInProgress && !Find.CameraDriver.config.gravshipFreeCam)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t}\n\n\tpublic IReadOnlyList PlayerHomeMaps\n\t{\n\t\tget\n\t\t{\n\t\t\tif (Faction.OfPlayerSilentFail == null)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\ttmpPlayerHomeMaps.Clear();\n\t\t\tfor (int i = 0; i < maps.Count; i++)\n\t\t\t{\n\t\t\t\tMap map = maps[i];\n\t\t\t\tif (map.IsPlayerHome)\n\t\t\t\t{\n\t\t\t\t\ttmpPlayerHomeMaps.Add(map);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn tmpPlayerHomeMaps;\n\t\t}\n\t}\n\n\tpublic Map RandomPlayerHomeMap\n\t{\n\t\tget\n\t\t{\n\t\t\tif (Faction.OfPlayerSilentFail == null)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\ttmpPlayerHomeMaps.Clear();\n\t\t\tfor (int i = 0; i < maps.Count; i++)\n\t\t\t{\n\t\t\t\tMap map = maps[i];\n\t\t\t\tif (map.IsPlayerHome)\n\t\t\t\t{\n\t\t\t\t\ttmpPlayerHomeMaps.Add(map);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (tmpPlayerHomeMaps.Any())\n\t\t\t{\n\t\t\t\tMap result = tmpPlayerHomeMaps.RandomElement();\n\t\t\t\ttmpPlayerHomeMaps.Clear();\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tpublic Map RandomRootSurfacePlayerHomeMap\n\t{\n\t\tget\n\t\t{\n\t\t\tif (Faction.OfPlayerSilentFail == null)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\ttmpPlayerHomeMaps.Clear();\n\t\t\tfor (int i = 0; i < maps.Count; i++)\n\t\t\t{\n\t\t\t\tMap map = maps[i];\n\t\t\t\tif (map.IsPlayerHome && map.Tile.Layer.IsRootSurface)\n\t\t\t\t{\n\t\t\t\t\ttmpPlayerHomeMaps.Add(map);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (tmpPlayerHomeMaps.Any())\n\t\t\t{\n\t\t\t\tMap result = tmpPlayerHomeMaps.RandomElement();\n\t\t\t\ttmpPlayerHomeMaps.Clear();\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tpublic Map RandomSurfacePlayerHomeMap\n\t{\n\t\tget\n\t\t{\n\t\t\tif (Faction.OfPlayerSilentFail == null)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\ttmpPlayerHomeMaps.Clear();\n\t\t\tfor (int i = 0; i < maps.Count; i++)\n\t\t\t{\n\t\t\t\tMap map = maps[i];\n\t\t\t\tif (map.IsPlayerHome && map.Tile.LayerDef.SurfaceTiles)\n\t\t\t\t{\n\t\t\t\t\ttmpPlayerHomeMaps.Add(map);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (tmpPlayerHomeMaps.Any())\n\t\t\t{\n\t\t\t\tMap result = tmpPlayerHomeMaps.RandomElement();\n\t\t\t\ttmpPlayerHomeMaps.Clear();\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tpublic List Maps => maps;\n\n\tpublic GameInitData InitData\n\t{\n\t\tget\n\t\t{\n\t\t\treturn initData;\n\t\t}\n\t\tset\n\t\t{\n\t\t\tinitData = value;\n\t\t}\n\t}\n\n\tpublic GameInfo Info => info;\n\n\tpublic GameRules Rules => rules;\n\n\tpublic Gravship Gravship\n\t{\n\t\tget\n\t\t{\n\t\t\treturn gravshipInt;\n\t\t}\n\t\tset\n\t\t{\n\t\t\tgravshipInt = value;\n\t\t}\n\t}\n\n\tpublic bool IsPlayerTile(PlanetTile tile)\n\t{\n\t\tfor (int i = 0; i < maps.Count; i++)\n\t\t{\n\t\t\tMap map = maps[i];\n\t\t\tif (map.Tile == tile && map.IsPlayerHome)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic Game()\n\t{\n\t\tFillComponents();\n\t}\n\n\tpublic void AddMap(Map map)\n\t{\n\t\tif (map == null)\n\t\t{\n\t\t\tLog.Error(\"Tried to add null map.\");\n\t\t\treturn;\n\t\t}\n\t\tif (maps.Contains(map))\n\t\t{\n\t\t\tLog.Error(\"Tried to add map but it's already here.\");\n\t\t\treturn;\n\t\t}\n\t\tif (maps.Count > 127)\n\t\t{\n\t\t\tLog.Error(\"Can't add map. Reached maps count limit (\" + sbyte.MaxValue + \").\");\n\t\t\treturn;\n\t\t}\n\t\tmaps.Add(map);\n\t\tFind.ColonistBar.MarkColonistsDirty();\n\t}\n\n\tpublic Map FindMap(MapParent mapParent)\n\t{\n\t\tfor (int i = 0; i < maps.Count; i++)\n\t\t{\n\t\t\tif (maps[i].info.parent == mapParent)\n\t\t\t{\n\t\t\t\treturn maps[i];\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic Map FindMap(PlanetTile tile)\n\t{\n\t\tfor (int i = 0; i < maps.Count; i++)\n\t\t{\n\t\t\tif (maps[i].Tile == tile)\n\t\t\t{\n\t\t\t\treturn maps[i];\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic void ExposeData()\n\t{\n\t\tif (Scribe.mode == LoadSaveMode.LoadingVars)\n\t\t{\n\t\t\tLog.Error(\"You must use special LoadData method to load Game.\");\n\t\t\treturn;\n\t\t}\n\t\tScribe_Values.Look(ref currentMapIndex, \"currentMapIndex\", -1);\n\t\tExposeSmallComponents();\n\t\tScribe_Deep.Look(ref worldInt, \"world\");\n\t\tScribe_Collections.Look(ref maps, \"maps\", LookMode.Deep);\n\t\tFind.CameraDriver.Expose();\n\t}\n\n\tprivate void ExposeSmallComponents()\n\t{\n\t\tScribe_Deep.Look(ref info, \"info\");\n\t\tScribe_Deep.Look(ref rules, \"rules\");\n\t\tScribe_Deep.Look(ref scenarioInt, \"scenario\");\n\t\tScribe_Deep.Look(ref tickManager, \"tickManager\");\n\t\tScribe_Deep.Look(ref playSettings, \"playSettings\");\n\t\tScribe_Deep.Look(ref storyWatcher, \"storyWatcher\");\n\t\tScribe_Deep.Look(ref gameEnder, \"gameEnder\");\n\t\tScribe_Deep.Look(ref letterStack, \"letterStack\");\n\t\tScribe_Deep.Look(ref researchManager, \"researchManager\");\n\t\tScribe_Deep.Look(ref analysisManager, \"analysisManager\");\n\t\tif (Scribe.mode == LoadSaveMode.LoadingVars && analysisManager == null)\n\t\t{\n\t\t\tanalysisManager = new AnalysisManager();\n\t\t}\n\t\tScribe_Deep.Look(ref storyteller, \"storyteller\");\n\t\tScribe_Deep.Look(ref history, \"history\");\n\t\tScribe_Deep.Look(ref taleManager, \"taleManager\");\n\t\tScribe_Deep.Look(ref playLog, \"playLog\");\n\t\tScribe_Deep.Look(ref battleLog, \"battleLog\");\n\t\tScribe_Deep.Look(ref outfitDatabase, \"outfitDatabase\");\n\t\tScribe_Deep.Look(ref drugPolicyDatabase, \"drugPolicyDatabase\");\n\t\tScribe_Deep.Look(ref foodRestrictionDatabase, \"foodRestrictionDatabase\");\n\t\tScribe_Deep.Look(ref readingPolicyDatabase, \"readingPolicyDatabase\");\n\t\tScribe_Deep.Look(ref tutor, \"tutor\");\n\t\tScribe_Deep.Look(ref dateNotifier, \"dateNotifier\");\n\t\tScribe_Deep.Look(ref uniqueIDsManager, \"uniqueIDsManager\");\n\t\tScribe_Deep.Look(ref questManager, \"questManager\");\n\t\tScribe_Deep.Look(ref transportShipManager, \"transportShipManager\");\n\t\tScribe_Deep.Look(ref studyManager, \"studyManager\");\n\t\tScribe_Deep.Look(ref customXenogermDatabase, \"customXenogermDatabase\");\n\t\tScribe_Deep.Look(ref customXenotypeDatabase, \"customXenotypeDatabase\");\n\t\tScribe_Deep.Look(ref relationshipRecords, \"relationshipRecords\");\n\t\tScribe_Deep.Look(ref hiddenItemsManager, \"hiddenItemsManager\");\n\t\tScribe_Deep.Look(ref entityCodex, \"entityCodex\");\n\t\tScribe_Collections.Look(ref components, \"components\", LookMode.Deep, this);\n\t\tif (Scribe.mode == LoadSaveMode.LoadingVars)\n\t\t{\n\t\t\tFillComponents();\n\t\t\tif (rules == null)\n\t\t\t{\n\t\t\t\tLog.Warning(\"Save game was missing rules. Replacing with a blank GameRules.\");\n\t\t\t\trules = new GameRules();\n\t\t\t}\n\t\t\tif (relationshipRecords == null)\n\t\t\t{\n\t\t\t\trelationshipRecords = new RelationshipRecords();\n\t\t\t}\n\t\t\tif (readingPolicyDatabase == null)\n\t\t\t{\n\t\t\t\treadingPolicyDatabase = new ReadingPolicyDatabase();\n\t\t\t}\n\t\t\tif (hiddenItemsManager == null)\n\t\t\t{\n\t\t\t\thiddenItemsManager = new HiddenItemsManager();\n\t\t\t}\n\t\t\tif (entityCodex == null)\n\t\t\t{\n\t\t\t\tentityCodex = new EntityCodex();\n\t\t\t}\n\t\t}\n\t\tBackCompatibility.PostExposeData(this);\n\t}\n\n\tprivate void FillComponents()\n\t{\n\t\tcomponents.RemoveAll((GameComponent component) => component == null);\n\t\tforeach (Type item2 in typeof(GameComponent).AllSubclassesNonAbstract())\n\t\t{\n\t\t\tif (GetComponent(item2) == null)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tGameComponent item = (GameComponent)Activator.CreateInstance(item2, this);\n\t\t\t\t\tcomponents.Add(item);\n\t\t\t\t}\n\t\t\t\tcatch (Exception ex)\n\t\t\t\t{\n\t\t\t\t\tLog.Error(\"Could not instantiate a GameComponent of type \" + item2?.ToString() + \": \" + ex);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic void InitNewGame()\n\t{\n\t\tstring text = LoadedModManager.RunningMods.Select((ModContentPack mod) => mod.PackageIdPlayerFacing + ((!mod.ModMetaData.VersionCompatible) ? \" (incompatible version)\" : \"\")).ToLineList(\" - \");\n\t\tLog.Message(\"Initializing new game with mods:\\n\" + text);\n\t\tif (maps.Any())\n\t\t{\n\t\t\tLog.Error(\"Called InitNewGame() but there already is a map. There should be 0 maps...\");\n\t\t\treturn;\n\t\t}\n\t\tif (initData == null)\n\t\t{\n\t\t\tLog.Error(\"Called InitNewGame() but init data is null. Create it first.\");\n\t\t\treturn;\n\t\t}\n\t\tClearCaches();\n\t\tMemoryUtility.UnloadUnusedUnityAssets();\n\t\ttry\n\t\t{\n\t\t\tCurrent.ProgramState = ProgramState.MapInitializing;\n\t\t\tIntVec3 intVec = new IntVec3(initData.mapSize, 1, initData.mapSize);\n\t\t\tSettlement settlement = null;\n\t\t\tList settlements = Find.WorldObjects.Settlements;\n\t\t\tfor (int i = 0; i < settlements.Count; i++)\n\t\t\t{\n\t\t\t\tif (settlements[i].Faction == Faction.OfPlayer)\n\t\t\t\t{\n\t\t\t\t\tsettlement = settlements[i];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (settlement == null)\n\t\t\t{\n\t\t\t\tLog.Error(\"Could not generate starting map because there is no any player faction base.\");\n\t\t\t}\n\t\t\ttickManager.gameStartAbsTick = GenTicks.ConfiguredTicksAbsAtGameStart;\n\t\t\tinfo.startingTile = initData.startingTile;\n\t\t\tinfo.startingAndOptionalPawns = initData.startingAndOptionalPawns;\n\t\t\tMap currentMap = MapGenerator.GenerateMap(intVec, settlement, initData.mapGeneratorDef ?? settlement.MapGeneratorDef, settlement.ExtraGenStepDefs);\n\t\t\tworldInt.info.initialMapSize = intVec;\n\t\t\tif (initData.permadeath)\n\t\t\t{\n\t\t\t\tinfo.permadeathMode = true;\n\t\t\t\tinfo.permadeathModeUniqueName = PermadeathModeUtility.GeneratePermadeathSaveName();\n\t\t\t}\n\t\t\tPawnUtility.GiveAllStartingPlayerPawnsThought(ThoughtDefOf.NewColonyOptimism);\n\t\t\tFinalizeInit();\n\t\t\tCurrent.Game.CurrentMap = currentMap;\n\t\t\tFind.CameraDriver.JumpToCurrentMapLoc(MapGenerator.PlayerStartSpot);\n\t\t\tFind.CameraDriver.ResetSize();\n\t\t\tif (Prefs.PauseOnLoad && initData.startedFromEntry)\n\t\t\t{\n\t\t\t\tLongEventHandler.ExecuteWhenFinished(delegate\n\t\t\t\t{\n\t\t\t\t\ttickManager.DoSingleTick();\n\t\t\t\t\ttickManager.CurTimeSpeed = TimeSpeed.Paused;\n\t\t\t\t});\n\t\t\t}\n\t\t\tFind.Scenario.PostGameStart();\n\t\t\thistory.FinalizeInit();\n\t\t\tResearchUtility.ApplyPlayerStartingResearch();\n\t\t\tGameComponentUtility.StartedNewGame();\n\t\t\tinitData = null;\n\t\t}\n\t\tfinally\n\t\t{\n\t\t}\n\t}\n\n\tpublic void LoadGame()\n\t{\n\t\tif (maps.Any())\n\t\t{\n\t\t\tLog.Error(\"Called LoadGame() but there already is a map. There should be 0 maps...\");\n\t\t\treturn;\n\t\t}\n\t\tClearCaches();\n\t\tMemoryUtility.UnloadUnusedUnityAssets();\n\t\tBackCompatibility.PreLoadSavegame(ScribeMetaHeaderUtility.loadedGameVersion);\n\t\tCurrent.ProgramState = ProgramState.MapInitializing;\n\t\tExposeSmallComponents();\n\t\tLongEventHandler.SetCurrentEventText(\"LoadingWorld\".Translate());\n\t\tif (Scribe.EnterNode(\"world\"))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tWorld = new World();\n\t\t\t\tWorld.ExposeData();\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\tScribe.ExitNode();\n\t\t\t}\n\t\t\tDeepProfiler.Start(\"World.FinalizeInit\");\n\t\t\tWorld.FinalizeInit(fromLoad: true);\n\t\t\tDeepProfiler.End();\n\t\t\tLongEventHandler.SetCurrentEventText(\"LoadingMap\".Translate());\n\t\t\tScribe_Collections.Look(ref maps, \"maps\", LookMode.Deep);\n\t\t\tif (maps.RemoveAll((Map x) => x == null) != 0)\n\t\t\t{\n\t\t\t\tLog.Warning(\"Some maps were null after loading.\");\n\t\t\t}\n\t\t\tint value = -1;\n\t\t\tScribe_Values.Look(ref value, \"currentMapIndex\", -1);\n\t\t\tif (value < 0 && maps.Any())\n\t\t\t{\n\t\t\t\tLog.Error(\"Current map is null after loading but there are maps available. Setting current map to [0].\");\n\t\t\t\tvalue = 0;\n\t\t\t}\n\t\t\tif (value >= maps.Count)\n\t\t\t{\n\t\t\t\tLog.Error(\"Current map index out of bounds after loading.\");\n\t\t\t\tvalue = ((!maps.Any()) ? (-1) : 0);\n\t\t\t}\n\t\t\tcurrentMapIndex = sbyte.MinValue;\n\t\t\tCurrentMap = ((value >= 0) ? maps[value] : null);\n\t\t\tLongEventHandler.SetCurrentEventText(\"InitializingGame\".Translate());\n\t\t\tFind.CameraDriver.Expose();\n\t\t\tDeepProfiler.Start(\"Scribe.loader.FinalizeLoading\");\n\t\t\tScribe.loader.FinalizeLoading();\n\t\t\tDeepProfiler.End();\n\t\t\tLongEventHandler.SetCurrentEventText(\"SpawningAllThings\".Translate());\n\t\t\tDeepProfiler.Start(\"maps.FinalizeLoading\");\n\t\t\tfor (int i = 0; i < maps.Count; i++)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tmaps[i].FinalizeLoading();\n\t\t\t\t}\n\t\t\t\tcatch (Exception ex)\n\t\t\t\t{\n\t\t\t\t\tLog.Error(\"Error in Map.FinalizeLoading(): \" + ex);\n\t\t\t\t}\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tmaps[i].Parent?.FinalizeLoading();\n\t\t\t\t}\n\t\t\t\tcatch (Exception ex2)\n\t\t\t\t{\n\t\t\t\t\tLog.Error(\"Error in MapParent.FinalizeLoading(): \" + ex2);\n\t\t\t\t}\n\t\t\t}\n\t\t\tDeepProfiler.End();\n\t\t\tDeepProfiler.Start(\"Game.FinalizeInit\");\n\t\t\tFinalizeInit();\n\t\t\tDeepProfiler.End();\n\t\t\tif (Prefs.PauseOnLoad)\n\t\t\t{\n\t\t\t\tLongEventHandler.ExecuteWhenFinished(delegate\n\t\t\t\t{\n\t\t\t\t\tFind.TickManager.DoSingleTick();\n\t\t\t\t\tFind.TickManager.CurTimeSpeed = TimeSpeed.Paused;\n\t\t\t\t});\n\t\t\t}\n\t\t\tGameComponentUtility.LoadedGame();\n\t\t\tBackCompatibility.PostLoadSavegame(ScribeMetaHeaderUtility.loadedGameVersion);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tLog.Error(\"Could not find world XML node.\");\n\t\t}\n\t}\n\n\tpublic void UpdateEntry()\n\t{\n\t\tGameComponentUtility.GameComponentUpdate();\n\t}\n\n\tpublic void UpdatePlay()\n\t{\n\t\ttry\n\t\t{\n\t\t\tFind.LetterStack.OpenAutomaticLetters();\n\t\t}\n\t\tcatch (Exception ex)\n\t\t{\n\t\t\tLog.Error(ex.ToString());\n\t\t}\n\t\ttickManager.TickManagerUpdate();\n\t\tletterStack.LetterStackUpdate();\n\t\tWorld.WorldUpdate();\n\t\tfor (int i = 0; i < maps.Count; i++)\n\t\t{\n\t\t\tmaps[i].MapUpdate();\n\t\t}\n\t\tInfo.GameInfoUpdate();\n\t\tGameComponentUtility.GameComponentUpdate();\n\t\tsignalManager.SignalManagerUpdate();\n\t\tGlobalTextureAtlasManager.GlobalTextureAtlasManagerUpdate();\n\t}\n\n\tpublic T GetComponent() where T : GameComponent\n\t{\n\t\tfor (int i = 0; i < components.Count; i++)\n\t\t{\n\t\t\tif (components[i] is T result)\n\t\t\t{\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic GameComponent GetComponent(Type type)\n\t{\n\t\tfor (int i = 0; i < components.Count; i++)\n\t\t{\n\t\t\tif (type.IsInstanceOfType(components[i]))\n\t\t\t{\n\t\t\t\treturn components[i];\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic void FinalizeInit()\n\t{\n\t\tLogSimple.FlushToFileAndOpen();\n\t\tresearchManager.ReapplyAllMods();\n\t\tMessagesRepeatAvoider.Reset();\n\t\tGameComponentUtility.FinalizeInit();\n\t\tCurrent.ProgramState = ProgramState.Playing;\n\t\tCurrent.Game.World.ideoManager.Notify_GameStarted();\n\t\tRecipeDefGenerator.ResetRecipeIngredientsForDifficulty();\n\t\tLongEventHandler.ExecuteWhenFinished(delegate\n\t\t{\n\t\t\tDebugSettings.devPalette = Prefs.StartDevPaletteOn;\n\t\t\tFind.UIRoot.debugWindowOpener.TryOpenOrClosePalette();\n\t\t});\n\t}\n\n\tpublic void DeinitAndRemoveMap(Map map, bool notifyPlayer)\n\t{\n\t\tif (map == null)\n\t\t{\n\t\t\tLog.Error(\"Tried to remove null map.\");\n\t\t\treturn;\n\t\t}\n\t\tif (!maps.Contains(map))\n\t\t{\n\t\t\tLog.Error(\"Tried to remove map \" + map?.ToString() + \" but it's not here.\");\n\t\t\treturn;\n\t\t}\n\t\tif (map.Parent != null)\n\t\t{\n\t\t\tmap.Parent.Notify_MyMapAboutToBeRemoved();\n\t\t}\n\t\tMap currentMap = CurrentMap;\n\t\tMapDeiniter.Deinit(map, notifyPlayer);\n\t\tmaps.Remove(map);\n\t\tif (currentMap != null)\n\t\t{\n\t\t\tsbyte b = (sbyte)maps.IndexOf(currentMap);\n\t\t\tif (b < 0)\n\t\t\t{\n\t\t\t\tif (maps.Any())\n\t\t\t\t{\n\t\t\t\t\tCurrentMap = maps[0];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tCurrentMap = null;\n\t\t\t\t}\n\t\t\t\tFind.World.renderer.wantedMode = WorldRenderMode.Planet;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcurrentMapIndex = b;\n\t\t\t}\n\t\t}\n\t\tif (Current.ProgramState == ProgramState.Playing)\n\t\t{\n\t\t\tFind.ColonistBar.MarkColonistsDirty();\n\t\t}\n\t\tMapComponentUtility.MapRemoved(map);\n\t\tFind.Scenario.MapRemoved(map);\n\t\tif (map.Parent != null)\n\t\t{\n\t\t\tmap.Parent.Notify_MyMapRemoved(map);\n\t\t}\n\t\tforeach (PocketMapParent item in Find.World.pocketMaps.ToList())\n\t\t{\n\t\t\tif (item.sourceMap == map && item.Map.generatorDef.pocketMapProperties.destroyOnParentMapAbandoned)\n\t\t\t{\n\t\t\t\tPocketMapUtility.DestroyPocketMap(item.Map);\n\t\t\t}\n\t\t}\n\t\tmap.Dispose();\n\t}\n\n\tpublic string DebugString()\n\t{\n\t\tStringBuilder stringBuilder = new StringBuilder();\n\t\tstringBuilder.AppendLine(\"Game debug data:\");\n\t\tstringBuilder.AppendLine(\"initData:\");\n\t\tif (initData == null)\n\t\t{\n\t\t\tstringBuilder.AppendLine(\" null\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tstringBuilder.AppendLine(initData.ToString());\n\t\t}\n\t\tstringBuilder.AppendLine(\"Scenario:\");\n\t\tif (scenarioInt == null)\n\t\t{\n\t\t\tstringBuilder.AppendLine(\" null\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tstringBuilder.AppendLine(\" \" + scenarioInt);\n\t\t}\n\t\tstringBuilder.AppendLine(\"World:\");\n\t\tif (worldInt == null)\n\t\t{\n\t\t\tstringBuilder.AppendLine(\" null\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tstringBuilder.AppendLine(\" name: \" + worldInt.info.name);\n\t\t}\n\t\tstringBuilder.AppendLine(\"Maps count: \" + maps.Count);\n\t\tfor (int i = 0; i < maps.Count; i++)\n\t\t{\n\t\t\tstringBuilder.AppendLine(\" Map \" + maps[i].Index + \":\");\n\t\t\tstringBuilder.AppendLine(\" tile: \" + maps[i].TileInfo);\n\t\t}\n\t\tstringBuilder.AppendLine(\"Game components:\");\n\t\tfor (int j = 0; j < components.Count; j++)\n\t\t{\n\t\t\tcomponents[j].AppendDebugString(stringBuilder);\n\t\t}\n\t\treturn stringBuilder.ToString();\n\t}\n\n\tpublic void Dispose()\n\t{\n\t\tfor (int i = 0; i < maps.Count; i++)\n\t\t{\n\t\t\tmaps[i].Dispose();\n\t\t}\n\t\tworldInt?.Dispose();\n\t\tSteadyEnvironmentEffects.Reset();\n\t\tUnityData.DisposeStaticResources();\n\t}\n\n\tpublic static void ClearCaches()\n\t{\n\t\tFind.ClearCache();\n\t\tChildcareUtility.ClearCache();\n\t\tSlaveRebellionUtility.ClearCache();\n\t\tAlert_NeedMeditationSpot.ClearCache();\n\t\tBuildCopyCommandUtility.ClearCache();\n\t\tMechanitorUtility.ClearCache();\n\t\tSocialCardUtility.ClearCaches();\n\t\tforeach (StatDef item in DefDatabase.AllDefsListForReading)\n\t\t{\n\t\t\titem.Worker.TryClearCache();\n\t\t}\n\t}\n}\n\n--- 结果 2 (相似度: 1.000) ---\n文件路径: C:\\Steam\\steamapps\\common\\RimWorld\\Data\\dll1.6\\Verse\\Map.txt\n\npublic sealed class Map : IIncidentTarget, ILoadReferenceable, IThingHolder, IExposable, IDisposable\n{\n\tpublic MapFileCompressor compressor;\n\n\tprivate List loadedFullThings;\n\n\tpublic MapGeneratorDef generatorDef;\n\n\tpublic int uniqueID = -1;\n\n\tpublic int generationTick;\n\n\tpublic bool wasSpawnedViaGravShipLanding;\n\n\tprivate Color? fogOfWarColor;\n\n\tprivate OrbitalDebrisDef orbitalDebris;\n\n\tprivate int generatedId;\n\n\tpublic MapInfo info = new MapInfo();\n\n\tpublic MapEvents events;\n\n\tpublic List components = new List();\n\n\tpublic ThingOwner spawnedThings;\n\n\tpublic CellIndices cellIndices;\n\n\tpublic ListerThings listerThings;\n\n\tpublic ListerBuildings listerBuildings;\n\n\tpublic MapPawns mapPawns;\n\n\tpublic DynamicDrawManager dynamicDrawManager;\n\n\tpublic MapDrawer mapDrawer;\n\n\tpublic PawnDestinationReservationManager pawnDestinationReservationManager;\n\n\tpublic TooltipGiverList tooltipGiverList;\n\n\tpublic ReservationManager reservationManager;\n\n\tpublic EnrouteManager enrouteManager;\n\n\tpublic PhysicalInteractionReservationManager physicalInteractionReservationManager;\n\n\tpublic DesignationManager designationManager;\n\n\tpublic LordManager lordManager;\n\n\tpublic PassingShipManager passingShipManager;\n\n\tpublic HaulDestinationManager haulDestinationManager;\n\n\tpublic DebugCellDrawer debugDrawer;\n\n\tpublic GameConditionManager gameConditionManager;\n\n\tpublic WeatherManager weatherManager;\n\n\tpublic ZoneManager zoneManager;\n\n\tpublic PlanManager planManager;\n\n\tpublic ResourceCounter resourceCounter;\n\n\tpublic MapTemperature mapTemperature;\n\n\tpublic TemperatureVacuumCache TemperatureVacuumCache;\n\n\tpublic AreaManager areaManager;\n\n\tpublic AttackTargetsCache attackTargetsCache;\n\n\tpublic AttackTargetReservationManager attackTargetReservationManager;\n\n\tpublic VoluntarilyJoinableLordsStarter lordsStarter;\n\n\tpublic FleckManager flecks;\n\n\tpublic DeferredSpawner deferredSpawner;\n\n\tpublic ThingGrid thingGrid;\n\n\tpublic CoverGrid coverGrid;\n\n\tpublic EdificeGrid edificeGrid;\n\n\tpublic BlueprintGrid blueprintGrid;\n\n\tpublic FogGrid fogGrid;\n\n\tpublic RegionGrid regionGrid;\n\n\tpublic GlowGrid glowGrid;\n\n\tpublic TerrainGrid terrainGrid;\n\n\tpublic Pathing pathing;\n\n\tpublic RoofGrid roofGrid;\n\n\tpublic FertilityGrid fertilityGrid;\n\n\tpublic SnowGrid snowGrid;\n\n\tpublic DeepResourceGrid deepResourceGrid;\n\n\tpublic ExitMapGrid exitMapGrid;\n\n\tpublic AvoidGrid avoidGrid;\n\n\tpublic GasGrid gasGrid;\n\n\tpublic PollutionGrid pollutionGrid;\n\n\tpublic SubstructureGrid substructureGrid;\n\n\tpublic WaterBodyTracker waterBodyTracker;\n\n\tpublic SandGrid sandGrid;\n\n\tpublic LinkGrid linkGrid;\n\n\tpublic PowerNetManager powerNetManager;\n\n\tpublic PowerNetGrid powerNetGrid;\n\n\tpublic RegionMaker regionMaker;\n\n\tpublic PathFinder pathFinder;\n\n\tpublic PawnPathPool pawnPathPool;\n\n\tpublic RegionAndRoomUpdater regionAndRoomUpdater;\n\n\tpublic RegionLinkDatabase regionLinkDatabase;\n\n\tpublic MoteCounter moteCounter;\n\n\tpublic GatherSpotLister gatherSpotLister;\n\n\tpublic WindManager windManager;\n\n\tpublic ListerBuildingsRepairable listerBuildingsRepairable;\n\n\tpublic ListerHaulables listerHaulables;\n\n\tpublic ListerMergeables listerMergeables;\n\n\tpublic ListerArtificialBuildingsForMeditation listerArtificialBuildingsForMeditation;\n\n\tpublic ListerBuldingOfDefInProximity listerBuldingOfDefInProximity;\n\n\tpublic ListerBuildingWithTagInProximity listerBuildingWithTagInProximity;\n\n\tpublic ListerFilthInHomeArea listerFilthInHomeArea;\n\n\tpublic Reachability reachability;\n\n\tpublic ItemAvailability itemAvailability;\n\n\tpublic AutoBuildRoofAreaSetter autoBuildRoofAreaSetter;\n\n\tpublic RoofCollapseBufferResolver roofCollapseBufferResolver;\n\n\tpublic RoofCollapseBuffer roofCollapseBuffer;\n\n\tpublic WildAnimalSpawner wildAnimalSpawner;\n\n\tpublic WildPlantSpawner wildPlantSpawner;\n\n\tpublic SteadyEnvironmentEffects steadyEnvironmentEffects;\n\n\tpublic TempTerrainManager tempTerrain;\n\n\tpublic FreezeManager freezeManager;\n\n\tpublic SkyManager skyManager;\n\n\tpublic OverlayDrawer overlayDrawer;\n\n\tpublic FloodFiller floodFiller;\n\n\tpublic WeatherDecider weatherDecider;\n\n\tpublic FireWatcher fireWatcher;\n\n\tpublic DangerWatcher dangerWatcher;\n\n\tpublic DamageWatcher damageWatcher;\n\n\tpublic StrengthWatcher strengthWatcher;\n\n\tpublic WealthWatcher wealthWatcher;\n\n\tpublic RegionDirtyer regionDirtyer;\n\n\tpublic MapCellsInRandomOrder cellsInRandomOrder;\n\n\tpublic RememberedCameraPos rememberedCameraPos;\n\n\tpublic MineStrikeManager mineStrikeManager;\n\n\tpublic StoryState storyState;\n\n\tpublic RoadInfo roadInfo;\n\n\tpublic WaterInfo waterInfo;\n\n\tpublic RetainedCaravanData retainedCaravanData;\n\n\tpublic TemporaryThingDrawer temporaryThingDrawer;\n\n\tpublic AnimalPenManager animalPenManager;\n\n\tpublic MapPlantGrowthRateCalculator plantGrowthRateCalculator;\n\n\tpublic AutoSlaughterManager autoSlaughterManager;\n\n\tpublic TreeDestructionTracker treeDestructionTracker;\n\n\tpublic StorageGroupManager storageGroups;\n\n\tpublic EffecterMaintainer effecterMaintainer;\n\n\tpublic PostTickVisuals postTickVisuals;\n\n\tpublic List layoutStructureSketches = new List();\n\n\tpublic ThingListChangedCallbacks thingListChangedCallbacks = new ThingListChangedCallbacks();\n\n\tpublic List landingBlockers = new List();\n\n\tpublic Tile pocketTileInfo;\n\n\tpublic const string ThingSaveKey = \"thing\";\n\n\t[TweakValue(\"Graphics_Shadow\", 0f, 100f)]\n\tprivate static bool AlwaysRedrawShadows;\n\n\tprivate MixedBiomeMapComponent mixedBiomeComp;\n\n\tpublic int Index => Find.Maps.IndexOf(this);\n\n\tpublic IntVec3 Size => info.Size;\n\n\tpublic IntVec3 Center => new IntVec3(Size.x / 2, 0, Size.z / 2);\n\n\tpublic Faction ParentFaction => info.parent?.Faction;\n\n\tpublic int Area => Size.x * Size.z;\n\n\tpublic IThingHolder ParentHolder => info.parent;\n\n\tpublic bool DrawMapClippers => !generatorDef.disableMapClippers;\n\n\tpublic bool CanEverExit\n\t{\n\t\tget\n\t\t{\n\t\t\tif (!info.isPocketMap)\n\t\t\t{\n\t\t\t\treturn Biome.canExitMap;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tpublic Color? FogOfWarColor\n\t{\n\t\tget\n\t\t{\n\t\t\treturn fogOfWarColor ?? Biome.fogOfWarColor;\n\t\t}\n\t\tset\n\t\t{\n\t\t\tfogOfWarColor = value;\n\t\t}\n\t}\n\n\tpublic OrbitalDebrisDef OrbitalDebris\n\t{\n\t\tget\n\t\t{\n\t\t\treturn orbitalDebris ?? Biome.orbitalDebris;\n\t\t}\n\t\tset\n\t\t{\n\t\t\torbitalDebris = value;\n\t\t}\n\t}\n\n\tpublic Material MapEdgeMaterial\n\t{\n\t\tget\n\t\t{\n\t\t\tif (ModsConfig.AnomalyActive && generatorDef == MapGeneratorDefOf.MetalHell)\n\t\t\t{\n\t\t\t\treturn MapEdgeClipDrawer.ClipMatMetalhell;\n\t\t\t}\n\t\t\tWorldObject parent = Parent;\n\t\t\tif (parent != null && parent.def.MapEdgeMaterial != null)\n\t\t\t{\n\t\t\t\treturn parent.def.MapEdgeMaterial;\n\t\t\t}\n\t\t\treturn MapEdgeClipDrawer.ClipMat;\n\t\t}\n\t}\n\n\tpublic bool Disposed { get; private set; }\n\n\tpublic IEnumerable AllCells\n\t{\n\t\tget\n\t\t{\n\t\t\tfor (int z = 0; z < Size.z; z++)\n\t\t\t{\n\t\t\t\tfor (int y = 0; y < Size.y; y++)\n\t\t\t\t{\n\t\t\t\t\tfor (int x = 0; x < Size.x; x++)\n\t\t\t\t\t{\n\t\t\t\t\t\tyield return new IntVec3(x, y, z);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic bool IsPlayerHome\n\t{\n\t\tget\n\t\t{\n\t\t\tif (!wasSpawnedViaGravShipLanding)\n\t\t\t{\n\t\t\t\tif (info?.parent != null && info.parent.Faction == Faction.OfPlayer)\n\t\t\t\t{\n\t\t\t\t\treturn info.parent.def.canBePlayerHome;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t}\n\n\tpublic bool TreatAsPlayerHomeForThreatPoints\n\t{\n\t\tget\n\t\t{\n\t\t\tif (IsPlayerHome)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif (info.parent != null && info.parent.def.treatAsPlayerHome)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tpublic bool IsTempIncidentMap => info.parent.def.isTempIncidentMapOwner;\n\n\tpublic PlanetTile Tile => info.Tile;\n\n\tpublic Tile TileInfo\n\t{\n\t\tget\n\t\t{\n\t\t\tif (!IsPocketMap)\n\t\t\t{\n\t\t\t\treturn Find.WorldGrid[Tile];\n\t\t\t}\n\t\t\treturn pocketTileInfo;\n\t\t}\n\t}\n\n\tpublic BiomeDef Biome => TileInfo.PrimaryBiome;\n\n\tpublic IEnumerable Biomes => TileInfo.Biomes;\n\n\tpublic MixedBiomeMapComponent MixedBiomeComp => mixedBiomeComp ?? (mixedBiomeComp = GetComponent());\n\n\tpublic bool IsStartingMap => Find.GameInfo.startingTile == Tile;\n\n\tpublic bool IsPocketMap => info.isPocketMap;\n\n\tpublic StoryState StoryState => storyState;\n\n\tpublic GameConditionManager GameConditionManager => gameConditionManager;\n\n\tpublic float PlayerWealthForStoryteller\n\t{\n\t\tget\n\t\t{\n\t\t\tif (TreatAsPlayerHomeForThreatPoints)\n\t\t\t{\n\t\t\t\tif (Find.Storyteller.difficulty.fixedWealthMode)\n\t\t\t\t{\n\t\t\t\t\treturn StorytellerUtility.FixedWealthModeMapWealthFromTimeCurve.Evaluate(AgeInDays * Find.Storyteller.difficulty.fixedWealthTimeFactor);\n\t\t\t\t}\n\t\t\t\treturn wealthWatcher.WealthItems + wealthWatcher.WealthBuildings * 0.5f + wealthWatcher.WealthPawns;\n\t\t\t}\n\t\t\tfloat num = 0f;\n\t\t\tforeach (Pawn item in mapPawns.PawnsInFaction(Faction.OfPlayer))\n\t\t\t{\n\t\t\t\tif (item.IsFreeColonist)\n\t\t\t\t{\n\t\t\t\t\tnum += WealthWatcher.GetEquipmentApparelAndInventoryWealth(item);\n\t\t\t\t}\n\t\t\t\tif (item.IsAnimal)\n\t\t\t\t{\n\t\t\t\t\tnum += item.MarketValue;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn num;\n\t\t}\n\t}\n\n\tpublic IEnumerable PlayerPawnsForStoryteller => mapPawns.PawnsInFaction(Faction.OfPlayer);\n\n\tpublic FloatRange IncidentPointsRandomFactorRange => FloatRange.One;\n\n\tpublic MapParent Parent => info.parent;\n\n\tpublic PocketMapParent PocketMapParent\n\t{\n\t\tget\n\t\t{\n\t\t\tif (!IsPocketMap)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn Parent as PocketMapParent;\n\t\t}\n\t}\n\n\tpublic IEnumerable ChildPocketMaps\n\t{\n\t\tget\n\t\t{\n\t\t\tforeach (PocketMapParent pocketMap in Find.World.pocketMaps)\n\t\t\t{\n\t\t\t\tif (pocketMap.sourceMap == this)\n\t\t\t\t{\n\t\t\t\t\tyield return pocketMap.Map;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic float AgeInDays => (float)(Find.TickManager.TicksGame - generationTick) / 60000f;\n\n\tpublic int NextGenSeed => HashCode.Combine(TileInfo.tile.Valid ? TileInfo.tile.GetHashCode() : uniqueID, generatedId++, Find.World.info.Seed);\n\n\tpublic int ConstantRandSeed => uniqueID ^ 0xFDA252;\n\n\tpublic IEnumerator GetEnumerator()\n\t{\n\t\tforeach (IntVec3 allCell in AllCells)\n\t\t{\n\t\t\tyield return allCell;\n\t\t}\n\t}\n\n\tpublic IEnumerable IncidentTargetTags()\n\t{\n\t\treturn info.parent?.IncidentTargetTags() ?? Enumerable.Empty();\n\t}\n\n\tpublic void ConstructComponents()\n\t{\n\t\tspawnedThings = new ThingOwner(this);\n\t\tcellIndices = new CellIndices(this);\n\t\tlisterThings = new ListerThings(ListerThingsUse.Global, thingListChangedCallbacks);\n\t\tlisterBuildings = new ListerBuildings();\n\t\tmapPawns = new MapPawns(this);\n\t\tdynamicDrawManager = new DynamicDrawManager(this);\n\t\tmapDrawer = new MapDrawer(this);\n\t\ttooltipGiverList = new TooltipGiverList();\n\t\tpawnDestinationReservationManager = new PawnDestinationReservationManager();\n\t\treservationManager = new ReservationManager(this);\n\t\tenrouteManager = new EnrouteManager(this);\n\t\tphysicalInteractionReservationManager = new PhysicalInteractionReservationManager();\n\t\tdesignationManager = new DesignationManager(this);\n\t\tlordManager = new LordManager(this);\n\t\tdebugDrawer = new DebugCellDrawer();\n\t\tpassingShipManager = new PassingShipManager(this);\n\t\thaulDestinationManager = new HaulDestinationManager(this);\n\t\tgameConditionManager = new GameConditionManager(this);\n\t\tweatherManager = new WeatherManager(this);\n\t\tzoneManager = new ZoneManager(this);\n\t\tplanManager = new PlanManager(this);\n\t\tresourceCounter = new ResourceCounter(this);\n\t\tmapTemperature = new MapTemperature(this);\n\t\tTemperatureVacuumCache = new TemperatureVacuumCache(this);\n\t\tareaManager = new AreaManager(this);\n\t\tattackTargetsCache = new AttackTargetsCache(this);\n\t\tattackTargetReservationManager = new AttackTargetReservationManager(this);\n\t\tlordsStarter = new VoluntarilyJoinableLordsStarter(this);\n\t\tflecks = new FleckManager(this);\n\t\tdeferredSpawner = new DeferredSpawner(this);\n\t\tthingGrid = new ThingGrid(this);\n\t\tcoverGrid = new CoverGrid(this);\n\t\tedificeGrid = new EdificeGrid(this);\n\t\tblueprintGrid = new BlueprintGrid(this);\n\t\tfogGrid = new FogGrid(this);\n\t\tglowGrid = new GlowGrid(this);\n\t\tregionGrid = new RegionGrid(this);\n\t\tterrainGrid = new TerrainGrid(this);\n\t\tpathing = new Pathing(this);\n\t\troofGrid = new RoofGrid(this);\n\t\tfertilityGrid = new FertilityGrid(this);\n\t\tsnowGrid = new SnowGrid(this);\n\t\tgasGrid = new GasGrid(this);\n\t\tpollutionGrid = new PollutionGrid(this);\n\t\tdeepResourceGrid = new DeepResourceGrid(this);\n\t\texitMapGrid = new ExitMapGrid(this);\n\t\tavoidGrid = new AvoidGrid(this);\n\t\tlinkGrid = new LinkGrid(this);\n\t\tpowerNetManager = new PowerNetManager(this);\n\t\tpowerNetGrid = new PowerNetGrid(this);\n\t\tregionMaker = new RegionMaker(this);\n\t\tpathFinder = new PathFinder(this);\n\t\tpawnPathPool = new PawnPathPool(this);\n\t\tregionAndRoomUpdater = new RegionAndRoomUpdater(this);\n\t\tregionLinkDatabase = new RegionLinkDatabase();\n\t\tmoteCounter = new MoteCounter();\n\t\tgatherSpotLister = new GatherSpotLister();\n\t\twindManager = new WindManager(this);\n\t\tlisterBuildingsRepairable = new ListerBuildingsRepairable();\n\t\tlisterHaulables = new ListerHaulables(this);\n\t\tlisterMergeables = new ListerMergeables(this);\n\t\tlisterFilthInHomeArea = new ListerFilthInHomeArea(this);\n\t\tlisterArtificialBuildingsForMeditation = new ListerArtificialBuildingsForMeditation(this);\n\t\tlisterBuldingOfDefInProximity = new ListerBuldingOfDefInProximity(this);\n\t\tlisterBuildingWithTagInProximity = new ListerBuildingWithTagInProximity(this);\n\t\treachability = new Reachability(this);\n\t\titemAvailability = new ItemAvailability(this);\n\t\tautoBuildRoofAreaSetter = new AutoBuildRoofAreaSetter(this);\n\t\troofCollapseBufferResolver = new RoofCollapseBufferResolver(this);\n\t\troofCollapseBuffer = new RoofCollapseBuffer();\n\t\twildAnimalSpawner = new WildAnimalSpawner(this);\n\t\twildPlantSpawner = new WildPlantSpawner(this);\n\t\tsteadyEnvironmentEffects = new SteadyEnvironmentEffects(this);\n\t\ttempTerrain = new TempTerrainManager(this);\n\t\tskyManager = new SkyManager(this);\n\t\toverlayDrawer = new OverlayDrawer();\n\t\tfloodFiller = new FloodFiller(this);\n\t\tweatherDecider = new WeatherDecider(this);\n\t\tfireWatcher = new FireWatcher(this);\n\t\tdangerWatcher = new DangerWatcher(this);\n\t\tdamageWatcher = new DamageWatcher();\n\t\tstrengthWatcher = new StrengthWatcher(this);\n\t\twealthWatcher = new WealthWatcher(this);\n\t\tregionDirtyer = new RegionDirtyer(this);\n\t\tcellsInRandomOrder = new MapCellsInRandomOrder(this);\n\t\trememberedCameraPos = new RememberedCameraPos(this);\n\t\tmineStrikeManager = new MineStrikeManager();\n\t\tstoryState = new StoryState(this);\n\t\tretainedCaravanData = new RetainedCaravanData(this);\n\t\ttemporaryThingDrawer = new TemporaryThingDrawer();\n\t\tanimalPenManager = new AnimalPenManager(this);\n\t\tplantGrowthRateCalculator = new MapPlantGrowthRateCalculator();\n\t\tautoSlaughterManager = new AutoSlaughterManager(this);\n\t\ttreeDestructionTracker = new TreeDestructionTracker(this);\n\t\tstorageGroups = new StorageGroupManager(this);\n\t\teffecterMaintainer = new EffecterMaintainer(this);\n\t\tpostTickVisuals = new PostTickVisuals(this);\n\t\tif (ModsConfig.OdysseyActive)\n\t\t{\n\t\t\tsubstructureGrid = new SubstructureGrid(this);\n\t\t\twaterBodyTracker = new WaterBodyTracker(this);\n\t\t\tfreezeManager = new FreezeManager(this);\n\t\t\tsandGrid = new SandGrid(this);\n\t\t}\n\t\tcomponents.Clear();\n\t\tFillComponents();\n\t}\n\n\tpublic void ExposeData()\n\t{\n\t\tif (Scribe.mode == LoadSaveMode.LoadingVars)\n\t\t{\n\t\t\tevents = new MapEvents(this);\n\t\t}\n\t\tScribe_Values.Look(ref uniqueID, \"uniqueID\", -1);\n\t\tScribe_Values.Look(ref generationTick, \"generationTick\", 0);\n\t\tScribe_Values.Look(ref wasSpawnedViaGravShipLanding, \"wasSpawnedViaGravShipLanding\", defaultValue: false);\n\t\tScribe_Values.Look(ref fogOfWarColor, \"fogOfWarColor\");\n\t\tScribe_Values.Look(ref generatedId, \"generatedId\", 0);\n\t\tScribe_Defs.Look(ref orbitalDebris, \"orbitalDebris\");\n\t\tScribe_Defs.Look(ref generatorDef, \"generatorDef\");\n\t\tScribe_Deep.Look(ref pocketTileInfo, \"pocketTileInfo\");\n\t\tScribe_Deep.Look(ref info, \"mapInfo\");\n\t\tScribe_Collections.Look(ref layoutStructureSketches, \"layoutStructureSketches\", LookMode.Deep);\n\t\tScribe_Collections.Look(ref landingBlockers, \"landingBlockers\", LookMode.Undefined);\n\t\tif (Scribe.mode == LoadSaveMode.Saving)\n\t\t{\n\t\t\tcompressor = new MapFileCompressor(this);\n\t\t\tcompressor.BuildCompressedString();\n\t\t\tExposeComponents();\n\t\t\tcompressor.ExposeData();\n\t\t\tHashSet hashSet = new HashSet();\n\t\t\tif (Scribe.EnterNode(\"things\"))\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tforeach (Thing allThing in listerThings.AllThings)\n\t\t\t\t\t{\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (allThing.def.isSaveable && !allThing.IsSaveCompressible())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (!hashSet.Add(allThing.ThingID))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tLog.Error(\"Saving Thing with already-used ID \" + allThing.ThingID);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\thashSet.Add(allThing.ThingID);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tThing target = allThing;\n\t\t\t\t\t\t\t\tScribe_Deep.Look(ref target, \"thing\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch (OutOfMemoryException)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthrow;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch (Exception arg)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tLog.Error($\"Exception saving {allThing}: {arg}\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfinally\n\t\t\t\t{\n\t\t\t\t\tScribe.ExitNode();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tLog.Error(\"Could not enter the things node while saving.\");\n\t\t\t}\n\t\t\tcompressor = null;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (Scribe.mode == LoadSaveMode.LoadingVars)\n\t\t\t{\n\t\t\t\tConstructComponents();\n\t\t\t\tregionAndRoomUpdater.Enabled = false;\n\t\t\t\tcompressor = new MapFileCompressor(this);\n\t\t\t}\n\t\t\telse if (Scribe.mode == LoadSaveMode.PostLoadInit && landingBlockers == null)\n\t\t\t{\n\t\t\t\tlandingBlockers = new List();\n\t\t\t}\n\t\t\tExposeComponents();\n\t\t\tDeepProfiler.Start(\"Load compressed things\");\n\t\t\tcompressor.ExposeData();\n\t\t\tDeepProfiler.End();\n\t\t\tDeepProfiler.Start(\"Load non-compressed things\");\n\t\t\tScribe_Collections.Look(ref loadedFullThings, \"things\", LookMode.Deep);\n\t\t\tDeepProfiler.End();\n\t\t}\n\t\tBackCompatibility.PostExposeData(this);\n\t}\n\n\tprivate void FillComponents()\n\t{\n\t\tcomponents.RemoveAll((MapComponent component) => component == null);\n\t\tforeach (Type item3 in typeof(MapComponent).AllSubclassesNonAbstract())\n\t\t{\n\t\t\tif (!typeof(CustomMapComponent).IsAssignableFrom(item3) && GetComponent(item3) == null)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tMapComponent item = (MapComponent)Activator.CreateInstance(item3, this);\n\t\t\t\t\tcomponents.Add(item);\n\t\t\t\t}\n\t\t\t\tcatch (Exception ex)\n\t\t\t\t{\n\t\t\t\t\tLog.Error(\"Could not instantiate a MapComponent of type \" + item3?.ToString() + \": \" + ex);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (generatorDef?.customMapComponents != null)\n\t\t{\n\t\t\tforeach (Type customMapComponent in generatorDef.customMapComponents)\n\t\t\t{\n\t\t\t\tif (GetComponent(customMapComponent) == null)\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tMapComponent item2 = (MapComponent)Activator.CreateInstance(customMapComponent, this);\n\t\t\t\t\t\tcomponents.Add(item2);\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Exception ex2)\n\t\t\t\t\t{\n\t\t\t\t\t\tLog.Error(\"Could not instantiate a MapComponent of type \" + customMapComponent?.ToString() + \": \" + ex2);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\troadInfo = GetComponent();\n\t\twaterInfo = GetComponent();\n\t}\n\n\tpublic void FinalizeLoading()\n\t{\n\t\tregionAndRoomUpdater.Enabled = true;\n\t\tList list = compressor.ThingsToSpawnAfterLoad().ToList();\n\t\tcompressor = null;\n\t\tDeepProfiler.Start(\"Merge compressed and non-compressed thing lists\");\n\t\tList list2 = new List(loadedFullThings.Count + list.Count);\n\t\tforeach (Thing item in loadedFullThings.Concat(list))\n\t\t{\n\t\t\tlist2.Add(item);\n\t\t}\n\t\tloadedFullThings.Clear();\n\t\tDeepProfiler.End();\n\t\tDeepProfiler.Start(\"Spawn everything into the map\");\n\t\tBackCompatibility.PreCheckSpawnBackCompatibleThingAfterLoading(this);\n\t\tforeach (Thing item2 in list2)\n\t\t{\n\t\t\tif (item2 is Building)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif (!BackCompatibility.CheckSpawnBackCompatibleThingAfterLoading(item2, this))\n\t\t\t\t{\n\t\t\t\t\tGenSpawn.Spawn(item2, item2.Position, this, item2.Rotation, WipeMode.FullRefund, respawningAfterLoad: true);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (Exception ex)\n\t\t\t{\n\t\t\t\tLog.Error(\"Exception spawning loaded thing \" + item2.ToStringSafe() + \": \" + ex);\n\t\t\t}\n\t\t}\n\t\tforeach (Building item3 in from t in list2.OfType()\n\t\t\torderby t.def.size.Magnitude\n\t\t\tselect t)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tGenSpawn.SpawnBuildingAsPossible(item3, this, respawningAfterLoad: true);\n\t\t\t}\n\t\t\tcatch (Exception ex2)\n\t\t\t{\n\t\t\t\tLog.Error(\"Exception spawning loaded thing \" + item3.ToStringSafe() + \": \" + ex2);\n\t\t\t}\n\t\t}\n\t\tBackCompatibility.PostCheckSpawnBackCompatibleThingAfterLoading(this);\n\t\tDeepProfiler.End();\n\t\tFinalizeInit();\n\t}\n\n\tpublic void FinalizeInit()\n\t{\n\t\tDeepProfiler.Start(\"Finalize geometry\");\n\t\tpathing.RecalculateAllPerceivedPathCosts();\n\t\tregionAndRoomUpdater.Enabled = true;\n\t\tregionAndRoomUpdater.RebuildAllRegionsAndRooms();\n\t\tpowerNetManager.UpdatePowerNetsAndConnections_First();\n\t\tTemperatureVacuumCache.TemperatureVacuumSaveLoad.ApplyLoadedDataToRegions();\n\t\tavoidGrid.Regenerate();\n\t\tanimalPenManager.RebuildAllPens();\n\t\tplantGrowthRateCalculator.BuildFor(this);\n\t\tgasGrid.RecalculateEverHadGas();\n\t\tDeepProfiler.End();\n\t\tDeepProfiler.Start(\"Thing.PostMapInit()\");\n\t\tforeach (Thing item in listerThings.AllThings.ToList())\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\titem.PostMapInit();\n\t\t\t}\n\t\t\tcatch (Exception ex)\n\t\t\t{\n\t\t\t\tLog.Error(\"Error in PostMapInit() for \" + item.ToStringSafe() + \": \" + ex);\n\t\t\t}\n\t\t}\n\t\tDeepProfiler.End();\n\t\tDeepProfiler.Start(\"listerFilthInHomeArea.RebuildAll()\");\n\t\tlisterFilthInHomeArea.RebuildAll();\n\t\tDeepProfiler.End();\n\t\tif (ModsConfig.OdysseyActive)\n\t\t{\n\t\t\tGetComponent().SetDrawerDirty();\n\t\t}\n\t\tLongEventHandler.ExecuteWhenFinished(delegate\n\t\t{\n\t\t\tmapDrawer.RegenerateEverythingNow();\n\t\t});\n\t\tDeepProfiler.Start(\"resourceCounter.UpdateResourceCounts()\");\n\t\tresourceCounter.UpdateResourceCounts();\n\t\tDeepProfiler.End();\n\t\tDeepProfiler.Start(\"wealthWatcher.ForceRecount()\");\n\t\twealthWatcher.ForceRecount(allowDuringInit: true);\n\t\tDeepProfiler.End();\n\t\tif (ModsConfig.OdysseyActive)\n\t\t{\n\t\t\tusing (new ProfilerBlock(\"WaterBodyTracker.ConstructBodies()\"))\n\t\t\t{\n\t\t\t\twaterBodyTracker?.ConstructBodies();\n\t\t\t}\n\t\t}\n\t\tMapComponentUtility.FinalizeInit(this);\n\t\tLongEventHandler.ExecuteWhenFinished(delegate\n\t\t{\n\t\t\tFind.MusicManagerPlay.CheckTransitions();\n\t\t});\n\t}\n\n\tprivate void ExposeComponents()\n\t{\n\t\tScribe_Deep.Look(ref weatherManager, \"weatherManager\", this);\n\t\tScribe_Deep.Look(ref reservationManager, \"reservationManager\", this);\n\t\tScribe_Deep.Look(ref enrouteManager, \"enrouteManager\", this);\n\t\tScribe_Deep.Look(ref physicalInteractionReservationManager, \"physicalInteractionReservationManager\");\n\t\tScribe_Deep.Look(ref planManager, \"planManager\", this);\n\t\tScribe_Deep.Look(ref designationManager, \"designationManager\", this);\n\t\tScribe_Deep.Look(ref pawnDestinationReservationManager, \"pawnDestinationReservationManager\");\n\t\tScribe_Deep.Look(ref lordManager, \"lordManager\", this);\n\t\tScribe_Deep.Look(ref passingShipManager, \"visitorManager\", this);\n\t\tScribe_Deep.Look(ref gameConditionManager, \"gameConditionManager\", this);\n\t\tScribe_Deep.Look(ref fogGrid, \"fogGrid\", this);\n\t\tScribe_Deep.Look(ref roofGrid, \"roofGrid\", this);\n\t\tScribe_Deep.Look(ref terrainGrid, \"terrainGrid\", this);\n\t\tScribe_Deep.Look(ref zoneManager, \"zoneManager\", this);\n\t\tScribe_Deep.Look(ref TemperatureVacuumCache, \"temperatureCache\", this);\n\t\tScribe_Deep.Look(ref snowGrid, \"snowGrid\", this);\n\t\tScribe_Deep.Look(ref gasGrid, \"gasGrid\", this);\n\t\tScribe_Deep.Look(ref pollutionGrid, \"pollutionGrid\", this);\n\t\tScribe_Deep.Look(ref waterBodyTracker, \"waterBodyTracker\", this);\n\t\tScribe_Deep.Look(ref areaManager, \"areaManager\", this);\n\t\tScribe_Deep.Look(ref lordsStarter, \"lordsStarter\", this);\n\t\tScribe_Deep.Look(ref attackTargetReservationManager, \"attackTargetReservationManager\", this);\n\t\tScribe_Deep.Look(ref deepResourceGrid, \"deepResourceGrid\", this);\n\t\tScribe_Deep.Look(ref weatherDecider, \"weatherDecider\", this);\n\t\tScribe_Deep.Look(ref damageWatcher, \"damageWatcher\");\n\t\tScribe_Deep.Look(ref rememberedCameraPos, \"rememberedCameraPos\", this);\n\t\tScribe_Deep.Look(ref mineStrikeManager, \"mineStrikeManager\");\n\t\tScribe_Deep.Look(ref retainedCaravanData, \"retainedCaravanData\", this);\n\t\tScribe_Deep.Look(ref storyState, \"storyState\", this);\n\t\tScribe_Deep.Look(ref tempTerrain, \"tempTerrain\", this);\n\t\tScribe_Deep.Look(ref wildPlantSpawner, \"wildPlantSpawner\", this);\n\t\tScribe_Deep.Look(ref temporaryThingDrawer, \"temporaryThingDrawer\");\n\t\tScribe_Deep.Look(ref flecks, \"flecks\", this);\n\t\tScribe_Deep.Look(ref deferredSpawner, \"deferredSpawner\", this);\n\t\tScribe_Deep.Look(ref autoSlaughterManager, \"autoSlaughterManager\", this);\n\t\tScribe_Deep.Look(ref treeDestructionTracker, \"treeDestructionTracker\", this);\n\t\tScribe_Deep.Look(ref storageGroups, \"storageGroups\", this);\n\t\tScribe_Deep.Look(ref sandGrid, \"sandGrid\", this);\n\t\tScribe_Collections.Look(ref components, \"components\", LookMode.Deep, this);\n\t\tif (Scribe.mode == LoadSaveMode.PostLoadInit)\n\t\t{\n\t\t\tif (planManager == null)\n\t\t\t{\n\t\t\t\tplanManager = new PlanManager(this);\n\t\t\t}\n\t\t\tif (ModsConfig.BiotechActive && pollutionGrid == null)\n\t\t\t{\n\t\t\t\tpollutionGrid = new PollutionGrid(this);\n\t\t\t}\n\t\t\tif (ModsConfig.OdysseyActive)\n\t\t\t{\n\t\t\t\tif (sandGrid == null)\n\t\t\t\t{\n\t\t\t\t\tsandGrid = new SandGrid(this);\n\t\t\t\t}\n\t\t\t\tif (substructureGrid == null)\n\t\t\t\t{\n\t\t\t\t\tsubstructureGrid = new SubstructureGrid(this);\n\t\t\t\t}\n\t\t\t\tif (waterBodyTracker == null)\n\t\t\t\t{\n\t\t\t\t\twaterBodyTracker = new WaterBodyTracker(this);\n\t\t\t\t}\n\t\t\t\tif (freezeManager == null)\n\t\t\t\t{\n\t\t\t\t\tfreezeManager = new FreezeManager(this);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tFillComponents();\n\t\tBackCompatibility.PostExposeData(this);\n\t}\n\n\tpublic void MapPreTick()\n\t{\n\t\titemAvailability.Tick();\n\t\tlisterHaulables.ListerHaulablesTick();\n\t\ttry\n\t\t{\n\t\t\tautoBuildRoofAreaSetter.AutoBuildRoofAreaSetterTick_First();\n\t\t}\n\t\tcatch (Exception ex)\n\t\t{\n\t\t\tLog.Error(ex.ToString());\n\t\t}\n\t\troofCollapseBufferResolver.CollapseRoofsMarkedToCollapse();\n\t\twindManager.WindManagerTick();\n\t\ttry\n\t\t{\n\t\t\tmapTemperature.MapTemperatureTick();\n\t\t}\n\t\tcatch (Exception ex2)\n\t\t{\n\t\t\tLog.Error(ex2.ToString());\n\t\t}\n\t\ttemporaryThingDrawer.Tick();\n\t\ttry\n\t\t{\n\t\t\tpathFinder.PathFinderTick();\n\t\t}\n\t\tcatch (Exception ex3)\n\t\t{\n\t\t\tLog.Error(ex3.ToString());\n\t\t}\n\t}\n\n\tpublic void MapPostTick()\n\t{\n\t\ttry\n\t\t{\n\t\t\twildAnimalSpawner.WildAnimalSpawnerTick();\n\t\t}\n\t\tcatch (Exception ex)\n\t\t{\n\t\t\tLog.Error(ex.ToString());\n\t\t}\n\t\ttry\n\t\t{\n\t\t\twildPlantSpawner.WildPlantSpawnerTick();\n\t\t}\n\t\tcatch (Exception ex2)\n\t\t{\n\t\t\tLog.Error(ex2.ToString());\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tpowerNetManager.PowerNetsTick();\n\t\t}\n\t\tcatch (Exception ex3)\n\t\t{\n\t\t\tLog.Error(ex3.ToString());\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tsteadyEnvironmentEffects.SteadyEnvironmentEffectsTick();\n\t\t}\n\t\tcatch (Exception ex4)\n\t\t{\n\t\t\tLog.Error(ex4.ToString());\n\t\t}\n\t\ttry\n\t\t{\n\t\t\ttempTerrain.Tick();\n\t\t}\n\t\tcatch (Exception ex5)\n\t\t{\n\t\t\tLog.Error(ex5.ToString());\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tgasGrid.Tick();\n\t\t}\n\t\tcatch (Exception ex6)\n\t\t{\n\t\t\tLog.Error(ex6.ToString());\n\t\t}\n\t\tif (ModsConfig.BiotechActive)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tpollutionGrid.PollutionTick();\n\t\t\t}\n\t\t\tcatch (Exception ex7)\n\t\t\t{\n\t\t\t\tLog.Error(ex7.ToString());\n\t\t\t}\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tdeferredSpawner.DeferredSpawnerTick();\n\t\t}\n\t\tcatch (Exception ex8)\n\t\t{\n\t\t\tLog.Error(ex8.ToString());\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tlordManager.LordManagerTick();\n\t\t}\n\t\tcatch (Exception ex9)\n\t\t{\n\t\t\tLog.Error(ex9.ToString());\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tpassingShipManager.PassingShipManagerTick();\n\t\t}\n\t\tcatch (Exception ex10)\n\t\t{\n\t\t\tLog.Error(ex10.ToString());\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tdebugDrawer.DebugDrawerTick();\n\t\t}\n\t\tcatch (Exception ex11)\n\t\t{\n\t\t\tLog.Error(ex11.ToString());\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tlordsStarter.VoluntarilyJoinableLordsStarterTick();\n\t\t}\n\t\tcatch (Exception ex12)\n\t\t{\n\t\t\tLog.Error(ex12.ToString());\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tgameConditionManager.GameConditionManagerTick();\n\t\t}\n\t\tcatch (Exception ex13)\n\t\t{\n\t\t\tLog.Error(ex13.ToString());\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tweatherManager.WeatherManagerTick();\n\t\t}\n\t\tcatch (Exception ex14)\n\t\t{\n\t\t\tLog.Error(ex14.ToString());\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tresourceCounter.ResourceCounterTick();\n\t\t}\n\t\tcatch (Exception ex15)\n\t\t{\n\t\t\tLog.Error(ex15.ToString());\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tweatherDecider.WeatherDeciderTick();\n\t\t}\n\t\tcatch (Exception ex16)\n\t\t{\n\t\t\tLog.Error(ex16.ToString());\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tfireWatcher.FireWatcherTick();\n\t\t}\n\t\tcatch (Exception ex17)\n\t\t{\n\t\t\tLog.Error(ex17.ToString());\n\t\t}\n\t\tif (ModsConfig.OdysseyActive)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\twaterBodyTracker?.Tick();\n\t\t\t}\n\t\t\tcatch (Exception ex18)\n\t\t\t{\n\t\t\t\tLog.Error(ex18.ToString());\n\t\t\t}\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tflecks.FleckManagerTick();\n\t\t}\n\t\tcatch (Exception ex19)\n\t\t{\n\t\t\tLog.Error(ex19.ToString());\n\t\t}\n\t\ttry\n\t\t{\n\t\t\teffecterMaintainer.EffecterMaintainerTick();\n\t\t}\n\t\tcatch (Exception ex20)\n\t\t{\n\t\t\tLog.Error(ex20.ToString());\n\t\t}\n\t\tMapComponentUtility.MapComponentTick(this);\n\t\ttry\n\t\t{\n\t\t\tforeach (TileMutatorDef mutator in TileInfo.Mutators)\n\t\t\t{\n\t\t\t\tmutator.Worker?.Tick(this);\n\t\t\t}\n\t\t}\n\t\tcatch (Exception ex21)\n\t\t{\n\t\t\tLog.Error(ex21.ToString());\n\t\t}\n\t}\n\n\tpublic void MapUpdate()\n\t{\n\t\tif (Disposed)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\tbool drawingMap = WorldRendererUtility.DrawingMap;\n\t\tskyManager.SkyManagerUpdate();\n\t\tpowerNetManager.UpdatePowerNetsAndConnections_First();\n\t\tregionGrid.UpdateClean();\n\t\tregionAndRoomUpdater.TryRebuildDirtyRegionsAndRooms();\n\t\tglowGrid.GlowGridUpdate_First();\n\t\tlordManager.LordManagerUpdate();\n\t\tpostTickVisuals.ProcessPostTickVisuals();\n\t\tif (drawingMap && Find.CurrentMap == this)\n\t\t{\n\t\t\tif (AlwaysRedrawShadows)\n\t\t\t{\n\t\t\t\tmapDrawer.WholeMapChanged(MapMeshFlagDefOf.Things);\n\t\t\t}\n\t\t\tGlobalRendererUtility.UpdateGlobalShadersParams();\n\t\t\tPlantFallColors.SetFallShaderGlobals(this);\n\t\t\twaterInfo.SetTextures();\n\t\t\tavoidGrid.DebugDrawOnMap();\n\t\t\tBreachingGridDebug.DebugDrawAllOnMap(this);\n\t\t\tmapDrawer.MapMeshDrawerUpdate_First();\n\t\t\tpowerNetGrid.DrawDebugPowerNetGrid();\n\t\t\tDoorsDebugDrawer.DrawDebug();\n\t\t\tmapDrawer.DrawMapMesh();\n\t\t\tdynamicDrawManager.DrawDynamicThings();\n\t\t\tgameConditionManager.GameConditionManagerDraw(this);\n\t\t\tMapEdgeClipDrawer.DrawClippers(this);\n\t\t\tdesignationManager.DrawDesignations();\n\t\t\toverlayDrawer.DrawAllOverlays();\n\t\t\ttemporaryThingDrawer.Draw();\n\t\t\tflecks.FleckManagerDraw();\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tareaManager.AreaManagerUpdate();\n\t\t}\n\t\tcatch (Exception ex)\n\t\t{\n\t\t\tLog.Error(ex.ToString());\n\t\t}\n\t\tweatherManager.WeatherManagerUpdate();\n\t\ttry\n\t\t{\n\t\t\tflecks.FleckManagerUpdate();\n\t\t}\n\t\tcatch (Exception ex2)\n\t\t{\n\t\t\tLog.Error(ex2.ToString());\n\t\t}\n\t\tMapComponentUtility.MapComponentUpdate(this);\n\t}\n\n\tpublic T GetComponent() where T : MapComponent\n\t{\n\t\tfor (int i = 0; i < components.Count; i++)\n\t\t{\n\t\t\tif (components[i] is T result)\n\t\t\t{\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic MapComponent GetComponent(Type type)\n\t{\n\t\tfor (int i = 0; i < components.Count; i++)\n\t\t{\n\t\t\tif (type.IsInstanceOfType(components[i]))\n\t\t\t{\n\t\t\t\treturn components[i];\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic void MapOnGUI()\n\t{\n\t\tDevGUISketches();\n\t\tDevRoadPaths();\n\t\tpathFinder.OnGUI();\n\t}\n\n\tprivate static void DevRoadPaths()\n\t{\n\t\tif (!DebugViewSettings.drawRoadPaths)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\tfor (int i = 0; i < GenStep_Roads.paths.Count; i++)\n\t\t{\n\t\t\tforeach (IntVec3 item in GenStep_Roads.paths[i])\n\t\t\t{\n\t\t\t\tVector2 vector = item.ToVector3Shifted().MapToUIPosition();\n\t\t\t\tDevGUI.DrawRect(new Rect(vector.x, vector.y, 5f, 5f), (i % 2 == 0) ? Color.yellow : Color.blue);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate void DevGUISketches()\n\t{\n\t\tif ((!DebugViewSettings.drawMapGraphs && !DebugViewSettings.drawMapRooms) || layoutStructureSketches.NullOrEmpty())\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\tforeach (LayoutStructureSketch layoutStructureSketch in layoutStructureSketches)\n\t\t{\n\t\t\tDebugGUILayoutStructure(layoutStructureSketch);\n\t\t}\n\t}\n\n\tprivate void DebugGUILayoutStructure(LayoutStructureSketch layoutStructureSketch)\n\t{\n\t\tDevDrawOutline(layoutStructureSketch.structureLayout.container, Color.yellow);\n\t\tVector2 pos = (layoutStructureSketch.structureLayout.container.Min - IntVec3.South).ToVector3().MapToUIPosition();\n\t\tDevDrawLabel(layoutStructureSketch.layoutDef.defName, pos);\n\t\tif (DebugViewSettings.drawMapGraphs && layoutStructureSketch.structureLayout?.neighbours != null)\n\t\t{\n\t\t\tforeach (KeyValuePair> connection in layoutStructureSketch.structureLayout.neighbours.connections)\n\t\t\t{\n\t\t\t\tforeach (Vector2 item in connection.Value)\n\t\t\t\t{\n\t\t\t\t\tVector2 vector = layoutStructureSketch.center.ToVector2();\n\t\t\t\t\tVector2 vector2 = vector + connection.Key;\n\t\t\t\t\tVector2 vector3 = vector + item;\n\t\t\t\t\tVector2 start = new Vector3(vector2.x, 0f, vector2.y).MapToUIPosition();\n\t\t\t\t\tVector2 end = new Vector3(vector3.x, 0f, vector3.y).MapToUIPosition();\n\t\t\t\t\tDevGUI.DrawLine(start, end, Color.green, 2f);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (!DebugViewSettings.drawMapRooms || layoutStructureSketch.structureLayout?.Rooms == null)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\tforeach (LayoutRoom room in layoutStructureSketch.structureLayout.Rooms)\n\t\t{\n\t\t\tstring name = \"NA\";\n\t\t\tif (!room.defs.NullOrEmpty())\n\t\t\t{\n\t\t\t\tname = room.defs.Select((LayoutRoomDef x) => x.defName).ToCommaList();\n\t\t\t}\n\t\t\tDevDrawLabel(name, room.rects[0].CenterVector3.MapToUIPosition());\n\t\t\tforeach (CellRect rect in room.rects)\n\t\t\t{\n\t\t\t\tDevDrawOutline(rect, Color.blue);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate static void DevDrawLabel(string name, Vector2 pos)\n\t{\n\t\tfloat widthCached = name.GetWidthCached();\n\t\tDevGUI.Label(new Rect(pos.x - widthCached / 2f, pos.y, widthCached, 20f), name);\n\t}\n\n\tprivate static void DevDrawOutline(CellRect r, Color color)\n\t{\n\t\tIntVec3 min = r.Min;\n\t\tIntVec3 intVec = r.Max + new IntVec3(1, 0, 1);\n\t\tIntVec3 a = new IntVec3(min.x, 0, min.z);\n\t\tIntVec3 intVec2 = new IntVec3(intVec.x, 0, min.z);\n\t\tIntVec3 intVec3 = new IntVec3(min.x, 0, intVec.z);\n\t\tIntVec3 b = new IntVec3(intVec.x, 0, intVec.z);\n\t\tDevDrawLine(a, intVec2, color);\n\t\tDevDrawLine(a, intVec3, color);\n\t\tDevDrawLine(intVec3, b, color);\n\t\tDevDrawLine(intVec2, b, color);\n\t}\n\n\tprivate static void DevDrawLine(IntVec3 a, IntVec3 b, Color color)\n\t{\n\t\tVector2 start = a.ToVector3().MapToUIPosition();\n\t\tVector2 end = b.ToVector3().MapToUIPosition();\n\t\tDevGUI.DrawLine(start, end, color, 2f);\n\t}\n\n\tpublic string GetUniqueLoadID()\n\t{\n\t\treturn \"Map_\" + uniqueID;\n\t}\n\n\tpublic override string ToString()\n\t{\n\t\tstring text = \"Map-\" + uniqueID;\n\t\tif (IsPlayerHome)\n\t\t{\n\t\t\ttext += \"-PlayerHome\";\n\t\t}\n\t\treturn text;\n\t}\n\n\tpublic ThingOwner GetDirectlyHeldThings()\n\t{\n\t\treturn spawnedThings;\n\t}\n\n\tpublic void GetChildHolders(List outChildren)\n\t{\n\t\tThingOwnerUtility.AppendThingHoldersFromThings(outChildren, listerThings.ThingsInGroup(ThingRequestGroup.ThingHolder));\n\t\tList passingShips = passingShipManager.passingShips;\n\t\tfor (int i = 0; i < passingShips.Count; i++)\n\t\t{\n\t\t\tif (passingShips[i] is IThingHolder item)\n\t\t\t{\n\t\t\t\toutChildren.Add(item);\n\t\t\t}\n\t\t}\n\t\tfor (int j = 0; j < components.Count; j++)\n\t\t{\n\t\t\tif (components[j] is IThingHolder item2)\n\t\t\t{\n\t\t\t\toutChildren.Add(item2);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic void Dispose()\n\t{\n\t\tif (Disposed)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\tDisposed = true;\n\t\tforeach (MapComponent component in components)\n\t\t{\n\t\t\tif (component is IDisposable disposable)\n\t\t\t{\n\t\t\t\tdisposable.Dispose();\n\t\t\t}\n\t\t}\n\t\tif (regionAndRoomUpdater != null)\n\t\t{\n\t\t\tregionAndRoomUpdater.Enabled = false;\n\t\t}\n\t\tpathFinder?.Dispose();\n\t\tlordManager?.Dispose();\n\t\tfogGrid?.Dispose();\n\t\tsnowGrid?.Dispose();\n\t\tglowGrid?.Dispose();\n\t\tsandGrid?.Dispose();\n\t\tavoidGrid?.Dispose();\n\t\tlisterBuildings?.Dispose();\n\t\tlisterThings?.Clear();\n\t\tregionDirtyer?.SetAllDirty();\n\t\tregionGrid?.Dispose();\n\t\tpathing?.Dispose();\n\t\tmapDrawer?.Dispose();\n\t\tResources.UnloadUnusedAssets();\n\t\tMapGenerator.ClearDebugMode();\n\t}\n}\n\n", + "timestamp": "2025-08-25 11:39:06,772" + }, + "MapGenerator": { + "keywords": [ + "MapGenerator" + ], + "question": "MapGenerator class definition", + "embedding": [ + -0.013261166401207447, + 0.05949479714035988, + -0.028810594230890274, + -0.06628279387950897, + 0.02472550980746746, + 0.019918624311685562, + 0.0394686721265316, + 0.050618186593055725, + 0.032496385276317596, + 0.10823937505483627, + 0.0031751547940075397, + -0.01603318750858307, + -0.06695852428674698, + 0.0024917477276176214, + -0.014029039070010185, + 0.04696311056613922, + -0.016048545017838478, + -0.08286885172128677, + -0.02228367328643799, + -0.018981819972395897, + 0.020486850291490555, + -0.026537690311670303, + -0.0036013242788612843, + -0.02455657720565796, + -0.024372287094593048, + -0.001914883148856461, + 0.04994245618581772, + 0.0457652285695076, + 0.006469329819083214, + -0.022790469229221344, + 0.016539983451366425, + -0.04103513062000275, + 0.036704327911138535, + -0.056054726243019104, + 0.03538358584046364, + 0.01372956857085228, + -0.0358135960996151, + 0.05639259144663811, + -0.0018294573528692126, + 0.02119329385459423, + -0.06529991328716278, + -0.005578597076237202, + 0.008177846670150757, + 0.010850044898688793, + -0.025524096563458443, + 0.0369807630777359, + 0.0025051855482161045, + -0.06170627102255821, + -0.0668356642127037, + -0.020302562043070793, + -0.010151281021535397, + 0.011579524725675583, + -0.00759042426943779, + -0.001471436582505703, + 0.04177228733897209, + 0.0238808486610651, + 0.03495357558131218, + -0.038332220166921616, + 0.019073965027928352, + 0.012086320668458939, + 0.02371191792190075, + 0.0058934250846505165, + -0.03323354199528694, + -0.021930452436208725, + 0.09742771834135056, + -0.05470326915383339, + 0.04214086756110191, + 0.0017065976280719042, + -0.03350997716188431, + -0.026860196143388748, + -0.012447220273315907, + -0.02475622482597828, + 0.013529921881854534, + 0.025048015639185905, + 0.015679966658353806, + 0.002136606490239501, + 0.006346470210701227, + -0.08673892915248871, + -0.02266760915517807, + 0.004215622786432505, + 0.02245260588824749, + -0.024894440546631813, + -0.020732570439577103, + 0.01424404326826334, + 0.03188208490610123, + 0.037103623151779175, + 0.0519082136452198, + 0.054764699190855026, + -0.040666550397872925, + -0.01704677939414978, + 0.026291970163583755, + -0.021561872214078903, + 0.019012534990906715, + 0.01578746736049652, + 0.028104150667786598, + -0.03185136988759041, + -0.0848960354924202, + -0.018444309011101723, + 0.0015223080990836024, + 0.0066958521492779255, + 0.026553047820925713, + -0.030484557151794434, + -0.06462419033050537, + 0.020287204533815384, + -0.035475730895996094, + 0.08336029201745987, + -0.027090558782219887, + -0.034830719232559204, + -0.011111121624708176, + -0.006918535567820072, + 0.015641571953892708, + -0.051693208515644073, + 0.045611653476953506, + 0.06763424724340439, + 0.006899338681250811, + 0.05961765721440315, + 0.0336635522544384, + 0.016386408358812332, + -0.0033709623385220766, + 0.014796911738812923, + 0.03384783864021301, + 0.021761519834399223, + -0.019273610785603523, + -0.020502207800745964, + 0.012700619176030159, + 0.00733318692073226, + 0.031697794795036316, + 0.049174584448337555, + -0.03360212221741676, + -0.0037760152481496334, + -0.00028555275639519095, + -0.008062666282057762, + -0.035230010747909546, + 0.018812887370586395, + -0.025877319276332855, + -0.01558782160282135, + 0.011456664651632309, + -0.03762577474117279, + -0.006638261955231428, + 0.03550644591450691, + -0.09110044687986374, + -0.013076876290142536, + 0.05261465534567833, + 0.008323743008077145, + 0.06787996739149094, + -0.019396470859646797, + -0.011456664651632309, + -0.02206866815686226, + 0.004507414065301418, + 0.019027892500162125, + -0.032987821847200394, + 0.019857194274663925, + -0.029839543625712395, + 0.03817864507436752, + -0.04530450329184532, + -0.019857194274663925, + -0.0030292589217424393, + -0.049174584448337555, + -0.003891196334734559, + -0.07273292541503906, + -0.029225245118141174, + 0.0044191088527441025, + -0.003585966769605875, + -0.004511253442615271, + 0.03802506998181343, + 0.03642789274454117, + 0.01681641861796379, + 0.0444444864988327, + 0.00020624588069040328, + -0.034984290599823, + -0.008561783470213413, + -0.007072110194712877, + 9.082497126655653e-05, + 0.01081165112555027, + 0.046072378754615784, + 0.001038548187352717, + -0.02183830738067627, + 0.05866549536585808, + -0.007717123255133629, + -0.06084625422954559, + 0.01516549102962017, + 0.026445545256137848, + 0.059187646955251694, + -0.02580053173005581, + -0.010420036502182484, + -0.019181465730071068, + -0.019826479256153107, + 0.020686497911810875, + 0.00340743619017303, + -0.04263230785727501, + 0.018213946372270584, + -0.006262003909796476, + 0.019488615915179253, + 0.006231288891285658, + -0.07666444033384323, + -0.010788614861667156, + 0.003015821101143956, + -0.022314388304948807, + 0.0027278687339276075, + -0.04100441560149193, + 0.002616527024656534, + 0.0034055165015161037, + 0.02165401726961136, + 0.012393469922244549, + -8.188645006157458e-05, + -0.02727484703063965, + -0.03148278966546059, + -0.060416243970394135, + 0.04892886430025101, + -0.015941042453050613, + 0.017522860318422318, + 0.0017008385621011257, + -0.01432850956916809, + -0.009644484147429466, + -0.005033407360315323, + -0.03206637501716614, + -0.0033920789137482643, + -0.032127805054187775, + 0.007859179750084877, + 0.046686675399541855, + -0.03971438854932785, + 0.02037934772670269, + 0.017737865447998047, + 0.013076876290142536, + 0.033786408603191376, + -0.006899338681250811, + 0.029977761209011078, + 0.010658076964318752, + -0.0022575464099645615, + -0.010834687389433384, + -0.002606928814202547, + -0.002998543903231621, + -0.03738005459308624, + 0.024879084900021553, + 0.022145455703139305, + -0.04558093845844269, + -0.019166110083460808, + -0.02538588084280491, + -0.0032058695796877146, + -0.011195587925612926, + -0.02598482184112072, + 0.013622066006064415, + -0.03535287082195282, + 0.05857335031032562, + 0.000992475776001811, + -0.04684025049209595, + -0.010020742192864418, + -0.013015447184443474, + 0.08243884146213531, + 0.00670353090390563, + 0.03122171387076378, + -0.012715976685285568, + 0.020486850291490555, + -0.017092851921916008, + 0.03704219311475754, + 0.030100619420409203, + 0.010343248955905437, + -0.010412357747554779, + -0.01350688561797142, + 0.013030803762376308, + -0.007210327312350273, + 0.018398236483335495, + -0.025263020768761635, + 0.07132004201412201, + -0.011364519596099854, + 0.010189673863351345, + -0.029424892738461494, + 0.05841977521777153, + -0.07881448417901993, + -0.04131156578660011, + -0.013130627572536469, + -0.007528994232416153, + 0.02722877450287342, + 0.0005917421076446772, + -0.015034952200949192, + 0.010266461409628391, + -0.02991633117198944, + -0.022713681682944298, + -0.013583673164248466, + -0.032742101699113846, + 0.003820168087258935, + 0.04389161989092827, + -0.04152657091617584, + 0.009168403223156929, + 0.010573610663414001, + 0.05175463855266571, + 0.0070375557988882065, + 0.009406443685293198, + -0.004346161149442196, + -0.004983495455235243, + 0.05467255413532257, + 0.026783408597111702, + -0.012001854367554188, + -0.02431085892021656, + -0.042509447783231735, + 0.010980583727359772, + 0.014904414303600788, + -0.0017267543589696288, + -0.03529144078493118, + -0.004326964262872934, + -0.00324810273014009, + 0.0008211441454477608, + -0.06139912083745003, + 0.005739850457757711, + 0.06189056113362312, + -0.01893574744462967, + -0.0034842235036194324, + -0.11020512878894806, + 0.01830609142780304, + -0.07261006534099579, + 0.052276790142059326, + 0.009897882118821144, + -0.008607855997979641, + 0.014236364513635635, + 0.02991633117198944, + -0.015457282774150372, + -0.032527100294828415, + 0.007717123255133629, + -0.02143901400268078, + 0.059586942195892334, + -0.08250027149915695, + -0.016739631071686745, + 0.01402136031538248, + 0.007521315477788448, + 0.0749443992972374, + -0.021300796419382095, + 0.02306690439581871, + 0.03633574768900871, + 0.013775641098618507, + -0.008776787668466568, + 0.056239016354084015, + 0.00789373368024826, + -0.020824715495109558, + 0.043983764946460724, + -0.06232057139277458, + 0.019811121746897697, + 0.021454371511936188, + -0.022206885740160942, + 0.006500044837594032, + -0.0391308069229126, + -0.037072908133268356, + 0.043369464576244354, + -0.04782312735915184, + 0.030607417225837708, + 0.017108209431171417, + 0.03476928919553757, + -0.036489322781562805, + 0.013107591308653355, + 0.07248720526695251, + 0.015894969925284386, + -0.017922155559062958, + 0.009176081977784634, + 0.045611653476953506, + 0.04653310030698776, + 0.015603178180754185, + -0.05012674629688263, + 0.00026515612262301147, + -0.02349691279232502, + -0.023235835134983063, + 0.003966063726693392, + 0.00048423989210277796, + 0.027090558782219887, + -0.016985349357128143, + 0.035015005618333817, + 0.054365403950214386, + -0.017384644597768784, + -0.023235835134983063, + -0.0007961882511153817, + -0.01994933933019638, + 0.03206637501716614, + 0.03848579153418541, + -0.009106973186135292, + -0.0006205373210832477, + 0.015027273446321487, + -0.08194740116596222, + 0.09890203922986984, + 0.01810644380748272, + -0.027489852160215378, + -0.026675906032323837, + 0.02824236825108528, + -0.014727803878486156, + 0.019473258405923843, + -0.03258853033185005, + -0.04309302940964699, + -0.00997466966509819, + -0.007206487935036421, + -0.02616911008954048, + 0.04235587269067764, + 0.001843854901380837, + -0.043369464576244354, + 0.08538747578859329, + 0.012063284404575825, + 0.004829920828342438, + -0.011640953831374645, + 0.0027413065545260906, + 0.01621747761964798, + -0.005693777929991484, + -0.0172464270144701, + 0.004434466361999512, + -0.004499735776335001, + -0.019703621044754982, + -0.004373036324977875, + 0.019242895767092705, + 0.010934511199593544, + -0.023420125246047974, + -0.034400708973407745, + 0.04100441560149193, + -0.018981819972395897, + 0.007033716421574354, + 0.012593116611242294, + -0.010550574399530888, + -0.04800741747021675, + 0.07414581626653671, + -0.0007688328041695058, + -0.02616911008954048, + -0.019242895767092705, + 0.032496385276317596, + 0.011456664651632309, + 0.03682718798518181, + 0.03612074255943298, + -0.026107680052518845, + -0.004181068390607834, + -0.06253557652235031, + -0.0305920597165823, + -0.010988262481987476, + 0.04551950842142105, + 0.02123936638236046, + -0.020947573706507683, + -0.034984290599823, + -0.01029717642813921, + 0.0378100648522377, + -0.03956081345677376, + -0.09048614650964737, + 0.037318624556064606, + -0.0007889894768595695, + -0.013552958145737648, + -0.0383015051484108, + -0.05181606858968735, + 0.002290181117132306, + -0.015242278575897217, + -0.03725719451904297, + 0.008116417564451694, + 0.000974718714132905, + -0.0031482791528105736, + -0.0004909588024020195, + -0.02721341699361801, + 0.028795236721634865, + 0.008661607280373573, + 0.020824715495109558, + 0.017292499542236328, + -0.016263550147414207, + -0.023374052718281746, + -0.016893204301595688, + -0.0033805607818067074, + 0.02100900374352932, + 0.04131156578660011, + 0.0017325134249404073, + -0.03243495523929596, + 0.015042630955576897, + -0.03329497203230858, + 0.03160564973950386, + 0.017799295485019684, + -0.0424480177462101, + 0.004050530027598143, + -0.002862246474251151, + 0.022974759340286255, + 0.026783408597111702, + -0.00588190695270896, + -0.046502385288476944, + -0.022713681682944298, + -0.025539454072713852, + 0.045611653476953506, + 0.020962931215763092, + -0.035076435655355453, + 0.03036169707775116, + -0.0295170359313488, + 0.002159642754122615, + 0.02494051307439804, + 0.016278907656669617, + -0.020241132006049156, + -0.03301853686571121, + 0.0034151149448007345, + -0.002242189133539796, + -0.050003886222839355, + -0.07304007560014725, + -0.03873151168227196, + 0.020840073004364967, + -0.05943336710333824, + -0.019411828368902206, + -0.013030803762376308, + -0.03384783864021301, + -0.0064462935552001, + 0.010466108098626137, + 0.015426567755639553, + -0.023834776133298874, + 0.0055632395669817924, + 0.03258853033185005, + 0.007985878735780716, + 0.023020831868052483, + 0.019012534990906715, + 0.007406134624034166, + 0.009529303759336472, + -0.022084025666117668, + -0.031697794795036316, + -0.019273610785603523, + 0.012209179811179638, + -0.018582526594400406, + 0.014159577898681164, + -0.0336635522544384, + -0.004326964262872934, + 0.028825951740145683, + -0.038147930055856705, + 0.035629305988550186, + -0.040605124086141586, + -0.00649620546028018, + 0.008116417564451694, + 0.04766955226659775, + 0.04929744452238083, + -0.027090558782219887, + 0.030853135511279106, + -0.009429479949176311, + -0.004131156485527754, + -0.01869002729654312, + 0.03787149488925934, + -0.05525613948702812, + 0.038117215037345886, + -0.01603318750858307, + 0.04238658770918846, + 0.02266760915517807, + -0.0070260376669466496, + 0.003388239536434412, + -0.011372198350727558, + -0.0424480177462101, + -0.004192586522549391, + 0.017783937975764275, + 0.02266760915517807, + -0.024602649733424187, + 1.862691897258628e-05, + 0.03185136988759041, + 0.08170168101787567, + 0.013990645296871662, + -0.006104589905589819, + 0.0008197043789550662, + -0.01681641861796379, + 0.023558342829346657, + 0.0017901038518175483, + 0.015319065190851688, + 0.015772109851241112, + -0.0027950576040893793, + -0.039007946848869324, + 0.007747838273644447, + -0.023128334432840347, + 0.035445015877485275, + -0.05135534331202507, + 0.004042851272970438, + -0.04994245618581772, + 0.024664079770445824, + 0.04696311056613922, + -0.017154281958937645, + 0.02976275607943535, + -0.014205649495124817, + -0.028027363121509552, + -0.017599647864699364, + -0.020517565310001373, + 0.006269682664424181, + 0.027597354725003242, + -0.060231953859329224, + 0.012800442054867744, + -0.02641483023762703, + -0.0016854811692610383, + -0.05633116140961647, + 0.011802207678556442, + -0.03704219311475754, + -0.00023864052491262555, + 0.05114033818244934, + 0.07261006534099579, + -1.3355290320760105e-05, + -0.013875464908778667, + 0.026153752580285072, + 0.023604415357112885, + -0.02953239344060421, + -0.041280850768089294, + -0.007160415407270193, + -0.03873151168227196, + 0.03203565999865532, + -0.016309620812535286, + -0.003443910274654627, + -0.0033786410931497812, + 0.03486143425107002, + -0.04963530972599983, + 0.044383056461811066, + 0.037963639944791794, + -0.04263230785727501, + -0.010335570201277733, + 0.02225295826792717, + 0.026445545256137848, + -0.01381403487175703, + -0.011802207678556442, + 9.556418808642775e-05, + 0.019058607518672943, + -0.003246183041483164, + -0.040635835379362106, + 0.020118271932005882, + -0.0010635040234774351, + -0.007694086991250515, + 0.05912621691823006, + -0.008438924327492714, + 0.010435394011437893, + 0.02472550980746746, + -0.013476170599460602, + 0.03372498229146004, + -0.00044296670239418745, + -0.012355076149106026, + 0.0008009874727576971, + 0.004119638353586197, + -0.03639717772603035, + 0.04008296877145767, + 0.003737621707841754, + -0.06219771131873131, + -0.025739101693034172, + 0.01578746736049652, + -0.025247663259506226, + 0.027704857289791107, + -0.024203356355428696, + -0.011802207678556442, + 0.052276790142059326, + -0.00790909118950367, + 0.01999541185796261, + -0.0021538836881518364, + -0.01163327507674694, + 0.022944044321775436, + -0.012938659638166428, + -0.03056134469807148, + 0.028994882479310036, + 0.052491795271635056, + 0.0029121581465005875, + 0.003459267783910036, + 0.004392233211547136, + 0.023635130375623703, + 0.04723954573273659, + 0.06744996458292007, + -0.012216858565807343, + -0.02451050467789173, + 0.02454121969640255, + 0.017522860318422318, + 0.01415189914405346, + -0.03264995664358139, + -0.024003708735108376, + -0.029839543625712395, + -0.013092233799397945, + 0.028227010741829872, + 0.05095604807138443, + 0.039192236959934235, + 0.028810594230890274, + -0.002418799791485071, + -0.029148457571864128, + -0.02429550141096115, + -0.0016173324547708035, + -0.00042592952377162874, + -0.03701147809624672, + -0.018229303881525993, + 0.005175463855266571, + -0.01266990415751934, + 0.04539664834737778, + -0.042509447783231735, + -0.006611386314034462, + 0.003927670419216156, + 0.02268296666443348, + 0.005409664940088987, + 0.03824007511138916, + 0.0030350179877132177, + -0.019181465730071068, + -0.0024360769893974066, + 0.06738853454589844, + -0.014789232984185219, + 0.025708386674523354, + -0.029624538496136665, + -0.031298503279685974, + 0.06075410917401314, + 0.001051026163622737, + 0.013545279391109943, + 0.044383056461811066, + -0.03350997716188431, + 0.02309761941432953, + -0.07580441981554031, + -0.016939276829361916, + 0.02512480318546295, + 0.013476170599460602, + -0.07193434238433838, + 0.01895110495388508, + 0.01319973636418581, + -0.021285438910126686, + 0.053751107305288315, + 0.0021462049335241318, + -0.03372498229146004, + -0.024372287094593048, + 0.015288351103663445, + -0.038608651608228683, + 0.01620212011039257, + 0.0441066212952137, + -0.0209782887250185, + -0.01789144054055214, + -0.006588350050151348, + -0.013476170599460602, + -0.0006416538381017745, + -0.02369656041264534, + -0.006361827719956636, + 0.012232216075062752, + 0.007678729481995106, + -0.0007280395366251469, + 0.030730275437235832, + 0.01603318750858307, + 0.012907944619655609, + -0.002426478546112776, + 0.01744607463479042, + -0.006177538074553013, + 0.010573610663414001, + -0.013076876290142536, + -0.03470785915851593, + 0.010343248955905437, + 0.0032154680229723454, + -0.016493910923600197, + -0.04017511382699013, + 0.0003649796126410365, + -0.02059435285627842, + 0.005590115208178759, + 0.05175463855266571, + -0.02205331064760685, + 0.02911774255335331, + 0.02973204106092453, + -0.005117873195558786, + -0.02560088410973549, + -0.011410592123866081, + -0.043369464576244354, + -0.033172111958265305, + -0.0014330429257825017, + -0.024080496281385422, + -0.0005379909998737276, + -0.016171405091881752, + -0.015703001990914345, + -0.03225066512823105, + -0.0201489869505167, + 0.036090027540922165, + -0.023865491151809692, + 0.05181606858968735, + -0.012639189139008522, + -0.005225375294685364, + 0.02059435285627842, + 0.054334692656993866, + -0.032742101699113846, + 0.02933274768292904, + 0.030699560418725014, + 0.01506566721946001, + -0.014658695086836815, + -0.04548879340291023, + -0.004557325970381498, + 0.05719117820262909, + 0.03455428406596184, + -0.012063284404575825, + 0.028641661629080772, + 0.013959930278360844, + -0.002791218226775527, + -0.014251722022891045, + 0.03790220990777016, + -0.02180759236216545, + 0.02601553685963154, + -0.020532922819256783, + 0.009721271693706512, + -0.04238658770918846, + -0.004776170011609793, + -0.03013133443892002, + -0.01640176586806774, + 0.053321097046136856, + 0.012024890631437302, + 0.049143869429826736, + 0.01424404326826334, + -0.009821095503866673, + 0.03134457394480705, + -0.0073715802282094955, + -0.03320282697677612, + 0.0837288647890091, + -0.0005091957864351571, + 0.006603707559406757, + 0.00572065357118845, + 0.018843602389097214, + 0.01847502402961254, + -0.01789144054055214, + -0.005536363925784826, + -0.024786939844489098, + -0.042079437524080276, + -0.026353400200605392, + -0.040420833975076675, + 0.035076435655355453, + -0.01681641861796379, + -0.04340017959475517, + 0.010266461409628391, + 0.005774404853582382, + -0.014374582096934319, + 0.011925066821277142, + 0.0519082136452198, + 0.010043778456747532, + -0.09349621087312698, + 0.008362136781215668, + -0.02517087571322918, + 0.03329497203230858, + 0.03323354199528694, + -0.020717212930321693, + -0.00048423989210277796, + 0.02165401726961136, + -0.05135534331202507, + 0.031943514943122864, + 0.014604943804442883, + 0.02891809493303299, + 0.01644783839583397, + -0.028595589101314545, + -0.02494051307439804, + -0.0411272756755352, + -0.006849426776170731, + -0.047730982303619385, + 0.020440777763724327, + 0.015518712811172009, + 0.07476010918617249, + 0.006419417914003134, + 0.03695004805922508, + 0.027812357991933823, + -0.022560108453035355, + 5.225135464570485e-05, + -0.004753133747726679, + 0.012500971555709839, + -0.005440379958599806, + 0.03286496177315712, + -0.031283143907785416, + -0.012531686574220657, + 0.01197113934904337, + 0.029348105192184448, + 0.02205331064760685, + -0.008454280905425549, + -0.0020732569973915815, + -0.027766285464167595, + 0.00303885736502707, + 0.003361363895237446, + 0.0005701456684619188, + -0.02931739017367363, + -0.04822242259979248, + -0.017400002107024193, + 0.010612004436552525, + -0.0058934250846505165, + -0.04072798043489456, + -0.009229833260178566, + -0.008246955461800098, + -0.019166110083460808, + 0.004334643017500639, + -0.028994882479310036, + -0.006968447007238865, + -0.01746143028140068, + 0.04671739041805267, + 0.023650487884879112, + -0.018582526594400406, + 0.0261998251080513, + -0.024848369881510735, + -0.01506566721946001, + -0.04785384237766266, + 0.0062888795509934425, + 0.006565313786268234, + 0.01038164272904396, + 0.015726039186120033, + 0.0761115700006485, + 0.015272993594408035, + -0.042970169335603714, + 0.019703621044754982, + 0.009905560873448849, + -0.022114740684628487, + 0.004184907767921686, + -0.029793471097946167, + 0.00954466126859188, + 0.01540353149175644, + -0.02974739857017994, + 0.03206637501716614, + 0.003225066466256976, + 0.022176170721650124, + -0.009275905787944794, + -0.05350538715720177, + -0.036520037800073624, + -0.023189762607216835, + 0.04432162642478943, + 0.007052913308143616, + 0.03116028569638729, + 0.033571407198905945, + -0.020625067874789238, + -0.005927979480475187, + -0.001962875248864293, + 0.02682948112487793, + 0.01664748601615429, + -0.028564874082803726, + -0.001681641791947186, + 0.034400708973407745, + -0.010665755718946457, + 0.011287732981145382, + -0.026030894368886948, + -0.0036934688687324524, + 0.026061607524752617, + -0.08753751963376999, + -0.02122400887310505, + 0.009260548278689384, + -0.04413733631372452, + -0.08508032560348511, + -0.05900335684418678, + -0.013990645296871662, + 0.01888967491686344, + -0.001401368179358542, + -0.029409535229206085, + 0.019304325804114342, + 0.0402979739010334, + 0.01217846479266882, + -0.041895147413015366, + -0.043768759816884995, + -0.05359753221273422, + 0.05132462829351425, + 0.013069197535514832, + 0.002848808653652668, + 0.021546514704823494, + -0.018152516335248947, + -0.004350000526756048, + 0.032772816717624664, + 0.02160794474184513, + -0.005943336524069309, + -0.04782312735915184, + -0.03999082371592522, + 0.0018428950570523739, + 0.03882365673780441, + -0.035660021007061005, + 0.016063902527093887, + 0.012431863695383072, + -0.01340706180781126, + -0.010742542333900928, + 0.028733806684613228, + -0.043123744428157806, + -0.02326655015349388, + -0.014604943804442883, + -0.053351812064647675, + -0.010143602266907692, + -0.01598711498081684, + 0.03759505972266197, + -0.0023996029049158096, + 0.03658146783709526, + 0.03486143425107002, + 0.0053751105442643166, + -0.027397707104682922, + -0.018045013770461082, + 0.04118870571255684, + -0.05504113435745239, + 0.013169021345674992, + 0.027581997215747833, + 0.012923302128911018, + -0.0020713373087346554, + 0.022974759340286255, + 0.003977581858634949, + -0.018382878974080086, + -0.004019815009087324, + -0.013652781024575233, + 0.053136810660362244, + 0.06480848044157028, + 0.018213946372270584, + -0.0898718535900116, + 0.01583353988826275, + -0.0407894104719162, + -0.0021692411974072456, + 0.04349232465028763, + 0.0394686721265316, + 0.016493910923600197, + 0.021976524963974953, + 0.01321509387344122, + 0.007601942401379347, + -0.028994882479310036, + 0.04631809890270233, + 0.011203266680240631, + -0.031283143907785416, + -0.010481465607881546, + 0.04429091140627861, + -0.005851191934198141, + 0.029056312516331673, + 0.03433927893638611, + -0.008285349234938622, + -0.002034863457083702, + -0.006615225691348314, + -0.0060086059384047985, + 0.027382349595427513, + -0.013453134335577488, + -0.02888738177716732, + -0.035260725766420364, + 0.027704857289791107, + -0.008615534752607346, + 0.0011047772131860256, + 0.03271138668060303, + 0.00452661095187068, + -0.05344395712018013, + -0.017522860318422318, + -0.05362824723124504, + -0.009291263297200203, + -0.026261255145072937, + 0.02328190766274929, + 0.031728509813547134, + 0.033755697309970856, + 0.03017740696668625, + -0.012608474120497704, + 0.01297705341130495, + 0.01183292269706726, + 0.0023535306099802256, + 0.0006243766983971, + -0.0844045951962471, + -0.037533629685640335, + -0.009222154505550861, + 0.009506267495453358, + 0.009337334893643856, + -0.007628818042576313, + 0.011402913369238377, + -0.06542277336120605, + -0.013591350987553596, + -0.046041663736104965, + 0.019043250009417534, + 0.02163865976035595, + -0.0009823974687606096, + 0.050003886222839355, + 0.050741046667099 + ], + "result": "--- 结果 1 (相似度: 1.000) ---\n文件路径: C:\\Steam\\steamapps\\common\\RimWorld\\Data\\dll1.6\\Verse\\MapGenerator.txt\n\npublic static class MapGenerator\n{\n\tpublic static Map mapBeingGenerated;\n\n\tprivate static IntVec3 playerStartSpotInt = IntVec3.Invalid;\n\n\tprivate static Gravship gravship;\n\n\tpublic static List rootsToUnfog = new List();\n\n\tprivate static Dictionary data = new Dictionary();\n\n\tprivate static List tmpGenSteps = new List();\n\n\tprivate static int debugSeed;\n\n\tpublic static bool debugMode = false;\n\n\tprivate static int debugGenStepIndex = 0;\n\n\tprivate static List cachedUsedRects = new List();\n\n\tpublic const string ElevationName = \"Elevation\";\n\n\tpublic const string FertilityName = \"Fertility\";\n\n\tpublic const string CavesName = \"Caves\";\n\n\tpublic const string RectOfInterestName = \"RectOfInterest\";\n\n\tpublic const string UsedRectsName = \"UsedRects\";\n\n\tpublic const string RectOfInterestTurretsGenStepsCount = \"RectOfInterestTurretsGenStepsCount\";\n\n\tpublic const string DontGenerateClearedGravShipTerrain = \"DontGenerateClearedGravShipTerrain\";\n\n\tpublic const string GravshipSpawnSet = \"GravshipSpawnSet\";\n\n\tpublic const string SpawnRectName = \"SpawnRect\";\n\n\tpublic static List tmpDataDump = new List();\n\n\tpublic static MapGenFloatGrid Elevation => FloatGridNamed(\"Elevation\");\n\n\tpublic static MapGenFloatGrid Fertility => FloatGridNamed(\"Fertility\");\n\n\tpublic static MapGenFloatGrid Caves => FloatGridNamed(\"Caves\");\n\n\tpublic static List UsedRects => GetOrGenerateVar>(\"UsedRects\");\n\n\tpublic static IntVec3 PlayerStartSpot\n\t{\n\t\tget\n\t\t{\n\t\t\tif (!PlayerStartSpotValid)\n\t\t\t{\n\t\t\t\tLog.Error(\"Accessing player start spot before setting it.\");\n\t\t\t\treturn IntVec3.Invalid;\n\t\t\t}\n\t\t\treturn playerStartSpotInt;\n\t\t}\n\t\tset\n\t\t{\n\t\t\tplayerStartSpotInt = value;\n\t\t}\n\t}\n\n\tpublic static bool PlayerStartSpotValid => playerStartSpotInt.IsValid;\n\n\tpublic static Map GenerateMap(IntVec3 mapSize, MapParent parent, MapGeneratorDef mapGenerator, IEnumerable extraGenStepDefs = null, Action extraInitBeforeContentGen = null, bool isPocketMap = false, bool stepDebugger = false)\n\t{\n\t\tProgramState programState = Current.ProgramState;\n\t\tCurrent.ProgramState = ProgramState.MapInitializing;\n\t\tClearWorkingData();\n\t\tplayerStartSpotInt = IntVec3.Invalid;\n\t\trootsToUnfog.Clear();\n\t\tmapBeingGenerated = null;\n\t\tgravship = null;\n\t\tDeepProfiler.Start(\"InitNewGeneratedMap\");\n\t\tRand.PushState();\n\t\tint seed = Gen.HashCombineInt(Find.World.info.Seed, parent?.Tile.GetHashCode() ?? 0);\n\t\tif (isPocketMap)\n\t\t{\n\t\t\tseed = Gen.HashCombineInt(Find.World.info.Seed, parent?.ID ?? Rand.Int);\n\t\t}\n\t\tRand.Seed = seed;\n\t\tif (stepDebugger)\n\t\t{\n\t\t\tdebugMode = true;\n\t\t\tdebugSeed = seed;\n\t\t\tdebugGenStepIndex = 0;\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tif (parent != null && parent.HasMap)\n\t\t\t{\n\t\t\t\tLog.Error($\"Tried to generate a new map and set {parent} as its parent, but this world object already has a map. One world object can't have more than 1 map.\");\n\t\t\t\tparent = null;\n\t\t\t}\n\t\t\tDeepProfiler.Start(\"Set up map\");\n\t\t\tMap map = new Map();\n\t\t\tmap.uniqueID = Find.UniqueIDsManager.GetNextMapID();\n\t\t\tmap.generationTick = GenTicks.TicksGame;\n\t\t\tmap.events = new MapEvents(map);\n\t\t\tmapBeingGenerated = map;\n\t\t\tmap.info.Size = mapSize;\n\t\t\tmap.info.parent = parent;\n\t\t\tif (mapGenerator == null)\n\t\t\t{\n\t\t\t\tLog.Error(\"Attempted to generate map without generator; falling back on encounter map\");\n\t\t\t\tmapGenerator = MapGeneratorDefOf.Encounter;\n\t\t\t}\n\t\t\tmap.generatorDef = mapGenerator;\n\t\t\tmap.info.disableSunShadows = mapGenerator.disableShadows;\n\t\t\tif (isPocketMap)\n\t\t\t{\n\t\t\t\tmap.info.isPocketMap = true;\n\t\t\t\tmap.pocketTileInfo = new Tile\n\t\t\t\t{\n\t\t\t\t\tPrimaryBiome = mapGenerator.pocketMapProperties.biome\n\t\t\t\t};\n\t\t\t\tforeach (TileMutatorDef tileMutator in mapGenerator.pocketMapProperties.tileMutators)\n\t\t\t\t{\n\t\t\t\t\tmap.TileInfo.AddMutator(tileMutator);\n\t\t\t\t}\n\t\t\t}\n\t\t\tmap.ConstructComponents();\n\t\t\tforeach (TileMutatorDef mutator in map.TileInfo.Mutators)\n\t\t\t{\n\t\t\t\tmutator.Worker?.Init(map);\n\t\t\t}\n\t\t\tDeepProfiler.End();\n\t\t\tCurrent.Game.AddMap(map);\n\t\t\tif (mapGenerator.isUnderground)\n\t\t\t{\n\t\t\t\tforeach (IntVec3 allCell in map.AllCells)\n\t\t\t\t{\n\t\t\t\t\tmap.roofGrid.SetRoof(allCell, mapGenerator.roofDef ?? RoofDefOf.RoofRockThick);\n\t\t\t\t}\n\t\t\t}\n\t\t\textraInitBeforeContentGen?.Invoke(map);\n\t\t\tIEnumerable enumerable = mapGenerator.genSteps.Where(IsValidBiome).Select(GetGenStepParms);\n\t\t\tforeach (TileMutatorDef mutator2 in map.TileInfo.Mutators)\n\t\t\t{\n\t\t\t\tif (mutator2.extraGenSteps.Any())\n\t\t\t\t{\n\t\t\t\t\tenumerable = enumerable.Concat(mutator2.extraGenSteps.Select(GetGenStepParms));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (map.Biome.extraGenSteps.Any())\n\t\t\t{\n\t\t\t\tenumerable = enumerable.Concat(map.Biome.extraGenSteps.Where(IsValidBiome).Select(GetGenStepParms));\n\t\t\t}\n\t\t\tif (map.Biome.preventGenSteps.Any())\n\t\t\t{\n\t\t\t\tenumerable = enumerable.Where((GenStepWithParams step) => !map.Biome.preventGenSteps.Contains(step.def));\n\t\t\t}\n\t\t\tforeach (TileMutatorDef mut in map.TileInfo.Mutators)\n\t\t\t{\n\t\t\t\tif (mut.preventGenSteps.Any())\n\t\t\t\t{\n\t\t\t\t\tenumerable = enumerable.Where((GenStepWithParams step) => !mut.preventGenSteps.Contains(step.def));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (extraGenStepDefs != null)\n\t\t\t{\n\t\t\t\tenumerable = enumerable.Concat(extraGenStepDefs);\n\t\t\t}\n\t\t\tenumerable = enumerable.Distinct();\n\t\t\tmap.areaManager.AddStartingAreas();\n\t\t\tmap.weatherDecider.StartInitialWeather();\n\t\t\tDeepProfiler.Start(\"Generate contents into map\");\n\t\t\tGenerateContentsIntoMap(enumerable, map, seed, stepDebugger);\n\t\t\tDeepProfiler.End();\n\t\t\tFind.Scenario.PostMapGenerate(map);\n\t\t\tDeepProfiler.Start(\"Finalize map init\");\n\t\t\tmap.FinalizeInit();\n\t\t\tDeepProfiler.End();\n\t\t\tDeepProfiler.Start(\"MapComponent.MapGenerated()\");\n\t\t\tMapComponentUtility.MapGenerated(map);\n\t\t\tDeepProfiler.End();\n\t\t\tparent?.PostMapGenerate();\n\t\t\tDeepProfiler.Start(\"Map generator post init\");\n\t\t\tif (!stepDebugger)\n\t\t\t{\n\t\t\t\tMapGeneratorPostInit(enumerable, map);\n\t\t\t}\n\t\t\tDeepProfiler.End();\n\t\t\tif (gravship != null && !stepDebugger && (bool)map.Parent.CanBeSettled)\n\t\t\t{\n\t\t\t\tGravshipUtility.SettleTile(map);\n\t\t\t}\n\t\t\tif (map.TileInfo.Layer.Def.isSpace)\n\t\t\t{\n\t\t\t\tLessonAutoActivator.TeachOpportunity(ConceptDefOf.Orbit, OpportunityType.Critical);\n\t\t\t}\n\t\t\treturn map;\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\tDeepProfiler.End();\n\t\t\tif (!stepDebugger)\n\t\t\t{\n\t\t\t\tClearWorkingData();\n\t\t\t\tmapBeingGenerated = null;\n\t\t\t\tgravship = null;\n\t\t\t}\n\t\t\tCurrent.ProgramState = programState;\n\t\t\tRand.PopState();\n\t\t}\n\t\tstatic GenStepWithParams GetGenStepParms(GenStepDef x)\n\t\t{\n\t\t\treturn new GenStepWithParams(x, default(GenStepParams));\n\t\t}\n\t\tstatic bool IsValidBiome(GenStepDef g)\n\t\t{\n\t\t\treturn !Find.Scenario.parts.Any((ScenPart p) => typeof(ScenPart_DisableMapGen).IsAssignableFrom(p.def.scenPartClass) && p.def.genStep == g);\n\t\t}\n\t}\n\n\tpublic static bool DebugDoNextGenStep(Map map)\n\t{\n\t\tif (debugGenStepIndex >= tmpGenSteps.Count)\n\t\t{\n\t\t\tClearDebugMode();\n\t\t\treturn false;\n\t\t}\n\t\tGenStepWithParams genStepWithParams = tmpGenSteps[debugGenStepIndex];\n\t\tLog.Message(\"Doing gen step \" + genStepWithParams.def.defName);\n\t\tRand.PushState(Gen.HashCombineInt(debugSeed, GetSeedPart(tmpGenSteps, debugGenStepIndex)));\n\t\ttry\n\t\t{\n\t\t\tGenStepParams parms = genStepWithParams.parms;\n\t\t\tif (gravship != null)\n\t\t\t{\n\t\t\t\tparms.gravship = gravship;\n\t\t\t}\n\t\t\tgenStepWithParams.def.genStep.Generate(map, parms);\n\t\t\tgenStepWithParams.def.genStep.PostMapInitialized(map, parms);\n\t\t}\n\t\tcatch (Exception arg)\n\t\t{\n\t\t\tLog.Error($\"Error stepping GenStep {genStepWithParams.def.defName}: {arg}\");\n\t\t}\n\t\tRand.PopState();\n\t\tmap.FinalizeInit();\n\t\tdebugGenStepIndex++;\n\t\treturn true;\n\t}\n\n\tpublic static void ClearDebugMode()\n\t{\n\t\tdebugMode = false;\n\t\tdebugSeed = 0;\n\t\tdebugGenStepIndex = 0;\n\t}\n\n\tpublic static void MapGeneratorPostInit(IEnumerable genStepDefs, Map map)\n\t{\n\t\ttmpGenSteps.Clear();\n\t\ttmpGenSteps.AddRange(from x in genStepDefs\n\t\t\torderby x.def.order, x.def.index\n\t\t\tselect x);\n\t\ttmpGenSteps.RemoveWhere((GenStepWithParams a) => tmpGenSteps.Any((GenStepWithParams b) => b.def.preventsGenSteps != null && b.def.preventsGenSteps.Contains(a.def)));\n\t\tfor (int i = 0; i < tmpGenSteps.Count; i++)\n\t\t{\n\t\t\tGenStepParams parms = tmpGenSteps[i].parms;\n\t\t\tif (gravship != null)\n\t\t\t{\n\t\t\t\tparms.gravship = gravship;\n\t\t\t}\n\t\t\ttmpGenSteps[i].def.genStep.PostMapInitialized(map, parms);\n\t\t}\n\t}\n\n\tpublic static void GenerateContentsIntoMap(IEnumerable genStepDefs, Map map, int seed, bool stepDebugger = false)\n\t{\n\t\tClearWorkingData();\n\t\tif (ModsConfig.OdysseyActive)\n\t\t{\n\t\t\tforeach (GenStepWithParams genStepDef in genStepDefs)\n\t\t\t{\n\t\t\t\tif (genStepDef.def == GenStepDefOf.GravshipMarker)\n\t\t\t\t{\n\t\t\t\t\tgravship = genStepDef.parms.gravship;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tRand.PushState();\n\t\ttry\n\t\t{\n\t\t\tRand.Seed = seed;\n\t\t\tRockNoises.Init(map);\n\t\t\ttmpGenSteps.Clear();\n\t\t\ttmpGenSteps.AddRange(from x in genStepDefs\n\t\t\t\torderby x.def.order, x.def.index\n\t\t\t\tselect x);\n\t\t\ttmpGenSteps.RemoveWhere((GenStepWithParams a) => tmpGenSteps.Any((GenStepWithParams b) => b.def.preventsGenSteps != null && b.def.preventsGenSteps.Contains(a.def)));\n\t\t\tif (stepDebugger)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfor (int i = 0; i < tmpGenSteps.Count; i++)\n\t\t\t{\n\t\t\t\tDeepProfiler.Start(\"GenStep - \" + tmpGenSteps[i].def);\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tGenStepParams parms = tmpGenSteps[i].parms;\n\t\t\t\t\tif (gravship != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tparms.gravship = gravship;\n\t\t\t\t\t}\n\t\t\t\t\tRand.PushState();\n\t\t\t\t\tRand.Seed = Gen.HashCombineInt(seed, GetSeedPart(tmpGenSteps, i));\n\t\t\t\t\ttmpGenSteps[i].def.genStep.Generate(map, parms);\n\t\t\t\t\tif (map.pathing.IncrementalDirtyingDisabled)\n\t\t\t\t\t{\n\t\t\t\t\t\tLog.Error($\"Genstep [{i}] {tmpGenSteps[i].def} ended with path incremental dirtying disabled, for safety reasons it must be reenabled before returning.\");\n\t\t\t\t\t\tmap.pathing.ReEnableIncrementalDirtying();\n\t\t\t\t\t}\n\t\t\t\t\tRand.PopState();\n\t\t\t\t}\n\t\t\t\tcatch (Exception arg)\n\t\t\t\t{\n\t\t\t\t\tLog.Error($\"Error in GenStep: {arg}\");\n\t\t\t\t}\n\t\t\t\tfinally\n\t\t\t\t{\n\t\t\t\t\tDeepProfiler.End();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\tif (!stepDebugger)\n\t\t\t{\n\t\t\t\tRand.PopState();\n\t\t\t\tRockNoises.Reset();\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate static void ClearWorkingData()\n\t{\n\t\tif (Prefs.DevMode && TryGetVar>(\"UsedRects\", out var var))\n\t\t{\n\t\t\tcachedUsedRects = var.ToList();\n\t\t}\n\t\tforeach (KeyValuePair datum in data)\n\t\t{\n\t\t\tdatum.Deconstruct(out var _, out var value);\n\t\t\tif (value is IDisposable disposable)\n\t\t\t{\n\t\t\t\tdisposable.Dispose();\n\t\t\t}\n\t\t}\n\t\tdata.Clear();\n\t}\n\n\tpublic static void DebugDraw()\n\t{\n\t\tif (!DebugViewSettings.drawUsedRects)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\tfloat y = AltitudeLayer.MetaOverlays.AltitudeFor();\n\t\tforeach (CellRect cachedUsedRect in cachedUsedRects)\n\t\t{\n\t\t\tGenDraw.DrawLineBetween(new Vector3(cachedUsedRect.minX, y, cachedUsedRect.minZ), new Vector3(cachedUsedRect.minX, y, cachedUsedRect.maxZ + 1), SimpleColor.Red);\n\t\t\tGenDraw.DrawLineBetween(new Vector3(cachedUsedRect.maxX + 1, y, cachedUsedRect.minZ), new Vector3(cachedUsedRect.maxX + 1, y, cachedUsedRect.maxZ + 1), SimpleColor.Red);\n\t\t\tGenDraw.DrawLineBetween(new Vector3(cachedUsedRect.minX, y, cachedUsedRect.minZ), new Vector3(cachedUsedRect.maxX + 1, y, cachedUsedRect.minZ), SimpleColor.Red);\n\t\t\tGenDraw.DrawLineBetween(new Vector3(cachedUsedRect.minX, y, cachedUsedRect.maxZ + 1), new Vector3(cachedUsedRect.maxX + 1, y, cachedUsedRect.maxZ + 1), SimpleColor.Red);\n\t\t}\n\t}\n\n\tpublic static T GetVar(string name)\n\t{\n\t\tif (data.TryGetValue(name, out var value))\n\t\t{\n\t\t\treturn (T)value;\n\t\t}\n\t\treturn default(T);\n\t}\n\n\tpublic static bool TryGetVar(string name, out T var)\n\t{\n\t\tif (data.TryGetValue(name, out var value))\n\t\t{\n\t\t\tvar = (T)value;\n\t\t\treturn true;\n\t\t}\n\t\tvar = default(T);\n\t\treturn false;\n\t}\n\n\tpublic static T GetOrGenerateVar(string name)\n\t{\n\t\tT var = GetVar(name);\n\t\tif (var != null)\n\t\t{\n\t\t\treturn var;\n\t\t}\n\t\tvar = (T)Activator.CreateInstance(typeof(T));\n\t\tSetVar(name, var);\n\t\treturn var;\n\t}\n\n\tpublic static void SetVar(string name, T var)\n\t{\n\t\tdata[name] = var;\n\t}\n\n\tpublic static MapGenFloatGrid FloatGridNamed(string name)\n\t{\n\t\tMapGenFloatGrid var = GetVar(name);\n\t\tif (var != null)\n\t\t{\n\t\t\treturn var;\n\t\t}\n\t\tMapGenFloatGrid mapGenFloatGrid = new MapGenFloatGrid(mapBeingGenerated);\n\t\tSetVar(name, mapGenFloatGrid);\n\t\treturn mapGenFloatGrid;\n\t}\n\n\tprivate static int GetSeedPart(List genSteps, int index)\n\t{\n\t\tint seedPart = genSteps[index].def.genStep.SeedPart;\n\t\tint num = 0;\n\t\tfor (int i = 0; i < index; i++)\n\t\t{\n\t\t\tif (tmpGenSteps[i].def.genStep.SeedPart == seedPart)\n\t\t\t{\n\t\t\t\tnum++;\n\t\t\t}\n\t\t}\n\t\treturn seedPart + num;\n\t}\n}\n\n", + "timestamp": "2025-08-25 11:39:55,702" + }, + "Map-destroyed-null": { + "keywords": [ + "Map", + "destroyed", + "null" + ], + "question": "Map check if destroyed or null methods", + "embedding": [ + -0.02629806287586689, + 0.017614584416151047, + 0.04774262011051178, + -0.02765176072716713, + -0.06454829126596451, + 0.004985571373254061, + 0.03275289013981819, + 0.02378876879811287, + -0.00615354860201478, + 0.06979799270629883, + 0.028411151841282845, + -0.04450695216655731, + -0.005068113561719656, + -0.005806869827210903, + -0.006520863156765699, + 0.04354945942759514, + -0.017614584416151047, + -0.12216300517320633, + -0.021972831338644028, + 0.006743727717548609, + -0.002952960319817066, + 0.015361172147095203, + 0.01943052001297474, + 0.005736708641052246, + -0.02185727283358574, + 0.002154360990971327, + 0.030953463166952133, + 0.07508072257041931, + -0.057383593171834946, + 0.0034956778399646282, + 0.004399518948048353, + 0.016673598438501358, + 0.03800259903073311, + -0.05157259851694107, + 0.04067697748541832, + 0.01037560123950243, + -0.03413960710167885, + 0.02814701572060585, + 0.030623292550444603, + 0.013305862434208393, + -0.04985571280121803, + 0.004275705199688673, + -0.0065910243429243565, + 0.007313271518796682, + 0.03394150361418724, + 0.06695853173732758, + 0.03595554456114769, + -0.026314571499824524, + -0.0497896783053875, + 0.020388014614582062, + -0.010581957176327705, + 0.052166905254125595, + 0.003889818675816059, + -0.058242037892341614, + 0.018951773643493652, + 0.014964967966079712, + -0.020685167983174324, + -0.02514246664941311, + -0.021725203841924667, + 0.0003776322409976274, + 0.015509748831391335, + 0.029698817059397697, + -0.017565058544278145, + -0.019215909764170647, + 0.07316572964191437, + -0.03744130954146385, + -0.04381359741091728, + 0.020965812727808952, + 0.009533667005598545, + -0.03836578503251076, + 0.03300051763653755, + 0.012686792761087418, + -0.033875469118356705, + 0.0008321322966367006, + -0.024548159912228584, + -0.002750731073319912, + 0.012075977399945259, + 0.01618659868836403, + 0.003906327299773693, + -0.02177472971379757, + 0.0221049003303051, + -0.012967437505722046, + 0.0015476731350645423, + 0.010796568356454372, + -0.025753282010555267, + 0.026892369613051414, + 0.005773852579295635, + -0.07587312906980515, + -0.04843597859144211, + 0.1151633933186531, + -0.0015311646275222301, + 0.014857662841677666, + 0.017482515424489975, + -0.005831632297486067, + 0.01967814937233925, + -0.025406602770090103, + -0.01934797875583172, + 0.015641815960407257, + 0.0108460932970047, + 0.04972364380955696, + -0.010573702864348888, + 0.0012082168832421303, + 0.008947614580392838, + 0.06263329833745956, + -0.01934797875583172, + 0.11225789040327072, + -0.06134563684463501, + 0.009938125498592854, + -0.024878330528736115, + 0.00397648848593235, + -0.017515532672405243, + -0.06322760879993439, + 0.01799428090453148, + 0.023904327303171158, + -0.001963481307029724, + 0.03204302489757538, + 0.023359546437859535, + -0.011126738041639328, + -0.008266638033092022, + -0.0004067801055498421, + 0.06603405624628067, + -0.031498245894908905, + -0.016954243183135986, + -0.01025178749114275, + -0.015394189395010471, + -0.012546470388770103, + 0.03275289013981819, + -0.003995060455054045, + -0.0045852395705878735, + 0.004164272453635931, + 0.018621603026986122, + -0.014593525789678097, + -0.014271610416471958, + -0.00044779342715628445, + -0.05513843521475792, + -0.029203560203313828, + 0.018605094403028488, + 0.0033966267947107553, + -0.018555570393800735, + 0.031993500888347626, + -0.0024865949526429176, + 0.016326921060681343, + 0.020189912989735603, + -0.03440374135971069, + 0.06979799270629883, + -0.03562537208199501, + -0.05021889880299568, + -0.00994637981057167, + 0.0014723531203344464, + -0.011531196534633636, + 0.017432991415262222, + -0.013569998554885387, + -0.010392109863460064, + 0.046785127371549606, + -0.020932795479893684, + 0.0024081794545054436, + 0.012018198147416115, + -0.05900142714381218, + 0.029962953180074692, + -0.056227996945381165, + 0.001328935381025076, + 0.034172624349594116, + -0.017779668793082237, + -0.00576147111132741, + 0.019744182005524635, + 0.007379305548965931, + -0.02094930410385132, + 0.034007538110017776, + -0.04952554032206535, + -0.042096711695194244, + -0.017763160169124603, + 0.016937734559178352, + -0.05256310850381851, + -0.002891053445637226, + 0.0442098006606102, + -0.021510593593120575, + 0.013388404622673988, + 0.053520601242780685, + -0.0253075510263443, + -0.055567655712366104, + 0.08340100944042206, + 0.021295983344316483, + 0.02950071357190609, + -0.03082139603793621, + 0.020553098991513252, + -0.07494865357875824, + 0.009409853257238865, + 0.039092160761356354, + 0.022781748324632645, + 0.00514652905985713, + 0.02922006882727146, + -0.01758156716823578, + 0.039884570986032486, + -0.0018045869655907154, + 0.0100454306229949, + -0.02930261194705963, + 0.009327310137450695, + -0.014172558672726154, + -0.06893955171108246, + -0.0025485018268227577, + 0.03866294026374817, + 0.007812654599547386, + 0.018440010026097298, + -0.017862211912870407, + -0.0034977414179593325, + -0.01243091095238924, + -0.007915832102298737, + -0.011159755289554596, + 0.0321255661547184, + -0.017119329422712326, + 0.07692967355251312, + -0.014123033732175827, + 0.032851941883563995, + -8.45416434458457e-05, + -0.018390484154224396, + -0.04064396023750305, + -0.022946834564208984, + -0.015963733196258545, + 0.006194819696247578, + 0.026265045627951622, + -0.023194462060928345, + 0.037540361285209656, + 0.027106979861855507, + 0.0070780254900455475, + -0.0019077651668339968, + -0.051506564021110535, + 0.023937344551086426, + 0.007767255883663893, + 0.03427167609333992, + 0.01574086770415306, + -0.03849785402417183, + 0.001762283849529922, + -0.0305737666785717, + 0.029071493074297905, + 0.0020831681322306395, + -0.014263356104493141, + -0.05431301146745682, + -0.0011762316571548581, + -0.0021770603489130735, + 0.0010844030184671283, + -0.050483036786317825, + 0.04269101843237877, + -0.013041726313531399, + 0.05883634462952614, + -0.007618679199367762, + -0.0353282205760479, + -0.018687637522816658, + 0.03347926586866379, + 0.01989275962114334, + -0.015022747218608856, + 0.03816768527030945, + 0.0026062815450131893, + -0.01873716339468956, + -0.06088339909911156, + -0.006747854873538017, + -0.003144871909171343, + 0.004267450887709856, + -0.02218744345009327, + 0.048832185566425323, + -0.04572858288884163, + -0.03767243027687073, + 0.026199011132121086, + -0.01926543563604355, + 0.01436240691691637, + -0.03288495913147926, + 0.025654230266809464, + 0.016838684678077698, + 0.02704094536602497, + -0.08280670642852783, + -0.09238164126873016, + -0.0134792011231184, + 0.03681398555636406, + 0.01754854992032051, + -0.04153542220592499, + 0.014090016484260559, + -0.014618288725614548, + 0.021593136712908745, + 0.03843181952834129, + 0.013215065002441406, + -0.014676068909466267, + 0.004073475953191519, + 0.02177472971379757, + 0.012901403941214085, + 0.028130507096648216, + 0.010400363244116306, + 0.04909631982445717, + 0.040577925741672516, + 0.015319900587201118, + 0.032901469618082047, + -0.027800336480140686, + 0.010524177923798561, + 0.037408292293548584, + 0.001700376975350082, + 0.020371505990624428, + 0.005010333843529224, + -0.022385545074939728, + -0.02022293023765087, + 0.0074948654510080814, + -0.01976069062948227, + 0.019744182005524635, + -0.010854347608983517, + -0.01273631863296032, + -0.005187800619751215, + -0.00043799151899293065, + 0.04163447022438049, + -0.07078851014375687, + -0.014040490612387657, + -0.11456908285617828, + 0.03516313433647156, + -0.04605875536799431, + 0.017515532672405243, + 0.04034680873155594, + -0.05078018829226494, + 0.01771363615989685, + -0.0015734677435830235, + 0.035196151584386826, + -0.04734641686081886, + -0.0014331453712657094, + 0.011242297478020191, + -8.08014374342747e-05, + 0.04655401036143303, + -0.016615819185972214, + -0.0007810590323060751, + 0.0035493304021656513, + 0.02753620035946369, + 0.0013629841851070523, + 0.0032047152053564787, + 0.0006680788937956095, + -0.020701676607131958, + -0.005047478247433901, + 0.0006969688110984862, + 0.006025607697665691, + -0.013388404622673988, + -0.022501103579998016, + -0.04051189124584198, + -0.02403639629483223, + -0.0019490363774821162, + -0.012562979012727737, + 0.056723251938819885, + 0.008823800832033157, + -0.012521707452833652, + -0.026842843741178513, + -0.04034680873155594, + -0.024234497919678688, + 0.012051215395331383, + 0.0305737666785717, + 0.021972831338644028, + 0.03684700280427933, + 0.014577018097043037, + 0.002003720961511135, + -0.050350967794656754, + 0.010879110544919968, + -0.018671128898859024, + 0.039059143513441086, + 0.03245573863387108, + -0.0660010352730751, + 0.03476693108677864, + -0.013116014190018177, + -0.020965812727808952, + -0.0018850659253075719, + 0.0027961295563727617, + 0.02296334318816662, + -0.024333549663424492, + 0.04321929067373276, + -0.013248082250356674, + -0.011919147334992886, + -0.0016322792507708073, + 0.04298816993832588, + -0.0061411671340465546, + 0.02880735695362091, + -0.004527459852397442, + -0.022055374458432198, + 0.04516729339957237, + 0.010400363244116306, + -0.05210087075829506, + 0.07105264067649841, + -0.006871669087558985, + -0.026265045627951622, + 0.03800259903073311, + -0.010920382104814053, + 0.046818144619464874, + 0.03869595751166344, + -0.033347196877002716, + -0.061576757580041885, + -0.0014228274812921882, + -0.020767711102962494, + -0.02855972945690155, + 0.014329389669001102, + -0.0022307129111140966, + -0.07204315066337585, + 0.05517145246267319, + 0.0061741843819618225, + -0.02198933996260166, + -0.0029797868337482214, + -0.06266631931066513, + 0.019414011389017105, + -0.007094533648341894, + 0.0334627591073513, + 0.008832055144011974, + -0.016838684678077698, + -0.006281489506363869, + -0.008576173335313797, + 0.04817184433341026, + -0.03024359792470932, + 0.03007851168513298, + -0.015427205711603165, + 0.045266345143318176, + -0.02477927878499031, + -0.02378876879811287, + -0.021213440224528313, + 0.00762280635535717, + -0.04064396023750305, + 0.0507141537964344, + 0.07818432152271271, + -0.04827089607715607, + -0.0069913556799292564, + 0.01139912847429514, + -0.016170090064406395, + 0.05124242603778839, + -0.00315312622115016, + -0.012818860821425915, + -0.009319055825471878, + -0.032241128385066986, + -0.004354120697826147, + 0.008217113092541695, + 0.02707396261394024, + 0.05124242603778839, + 0.01581515558063984, + -0.017862211912870407, + 0.043087221682071686, + -0.0024164337664842606, + -0.03073885291814804, + 0.001964513212442398, + 0.05444507673382759, + 0.002282302128151059, + -0.011316586285829544, + -0.03390848636627197, + -0.014519237913191319, + -0.02022293023765087, + -0.013751591555774212, + 0.021626153960824013, + -0.005588131956756115, + -0.025324059650301933, + -0.02588534913957119, + -0.04605875536799431, + -0.0732317641377449, + 0.052662160247564316, + -0.01713583804666996, + 0.023475106805562973, + 0.040577925741672516, + -0.022913817316293716, + -0.0041539547964930534, + 0.01401572860777378, + 0.022567138075828552, + -0.008906343020498753, + 0.029467696323990822, + -0.0185390617698431, + -0.033347196877002716, + -0.02707396261394024, + 0.015501494519412518, + 0.06111451983451843, + 0.0055386065505445, + -0.02884037420153618, + 0.012629013508558273, + -0.002034674398601055, + 0.007940595038235188, + -0.017482515424489975, + -0.008126315660774708, + -0.005435428116470575, + -0.04094111546874046, + 0.012992200441658497, + 0.027585726231336594, + 0.014048744924366474, + -0.020041335374116898, + 0.02568724751472473, + -0.06629819422960281, + -0.008592681027948856, + 0.048468995839357376, + 0.002496912609785795, + 0.017350448295474052, + 0.02403639629483223, + 0.010656245984137058, + -0.030177563428878784, + 0.0031882068142294884, + -0.05196880176663399, + -0.06045417860150337, + -0.02326049655675888, + -0.03668191656470299, + 0.025489145889878273, + -0.05431301146745682, + -0.04070999473333359, + 0.0002311191929038614, + 0.01741648279130459, + 0.01721837930381298, + -0.015716105699539185, + 0.022286493331193924, + 0.010780059732496738, + -0.0008352276054210961, + 0.008134569972753525, + -0.07673157006502151, + 0.002602154389023781, + 0.023326529189944267, + -0.01631866581737995, + -0.040776029229164124, + 0.06758585572242737, + -0.004341739229857922, + -0.07481658458709717, + 0.031052514910697937, + -0.052860260009765625, + -0.031250618398189545, + -0.001946972799487412, + -0.020487066358327866, + 0.03592252731323242, + -0.019958794116973877, + 0.015749122947454453, + 0.024416092783212662, + 0.0402807742357254, + 0.07448641210794449, + -0.0065414984710514545, + 0.012257571332156658, + 0.006871669087558985, + -0.053025346249341965, + -0.020899778231978416, + -0.032191600650548935, + -0.030540751293301582, + 0.026859352365136147, + 0.01444495003670454, + -0.01374333817511797, + -0.05262914299964905, + -0.02177472971379757, + -0.03929026424884796, + 0.03126712515950203, + 0.01943052001297474, + -0.0074701025150716305, + 0.07342986762523651, + 0.01163024827837944, + -0.019083842635154724, + -0.011374366469681263, + 0.032191600650548935, + 0.016409462317824364, + 0.0075402637012302876, + -0.027338098734617233, + -0.008345053531229496, + -0.021840764209628105, + 0.024647211655974388, + -0.057416610419750214, + 0.005249707493931055, + 0.01931496150791645, + -0.010771805420517921, + -0.005179546307772398, + 0.002234840067103505, + 0.02704094536602497, + 0.04936045780777931, + -0.005617022048681974, + 0.027998439967632294, + -0.0033099569845944643, + 0.029814375564455986, + 0.043285321444272995, + 0.00846061296761036, + 0.0012897276319563389, + -0.01749902404844761, + -0.05292629450559616, + -0.008898088708519936, + -0.009112699888646603, + 0.019248927012085915, + -0.034337710589170456, + 0.0035513939801603556, + 0.009896853938698769, + -0.050020795315504074, + 0.01885272189974785, + -0.07877862453460693, + 0.007024372462183237, + -0.026809826493263245, + 0.028873391449451447, + -0.01099466998130083, + 0.03225763514637947, + -0.018423501402139664, + 0.030276615172624588, + 0.04774262011051178, + 0.010903873480856419, + 0.0007206997834146023, + 0.009294292889535427, + -0.03232366964221001, + -0.04318627342581749, + 0.011374366469681263, + -0.021345509216189384, + -0.00038304910412989557, + 0.022484594956040382, + 0.049294423311948776, + -0.02704094536602497, + 0.06359079480171204, + -0.032356686890125275, + -0.06299649178981781, + -0.009756531566381454, + -0.0098638366907835, + 0.05120940878987312, + 0.017036786302924156, + 0.04655401036143303, + 0.017267905175685883, + 0.0457616001367569, + -0.029368646442890167, + -0.03783751279115677, + -0.006813888903707266, + -0.009228259325027466, + -0.018390484154224396, + 0.026149485260248184, + -0.00011884840205311775, + -0.014370661228895187, + 0.040743011981248856, + 0.014048744924366474, + -0.029071493074297905, + 0.04034680873155594, + -0.03579045832157135, + -0.007626933511346579, + -0.011002924293279648, + 0.01569959707558155, + 0.02855972945690155, + -0.00483699468895793, + -0.03068932704627514, + 0.005216690246015787, + 0.04199765995144844, + -0.0060544973239302635, + -0.003656635759398341, + -0.022666189819574356, + 0.005357012618333101, + -0.011308331973850727, + 0.05451111122965813, + -0.002851845696568489, + 0.025241518393158913, + 0.0060462430119514465, + -0.02136201597750187, + -0.04962459206581116, + 0.0082625113427639, + 0.030623292550444603, + 0.051869750022888184, + -0.016211360692977905, + 0.014073507860302925, + 0.01374333817511797, + 0.007705349009484053, + -0.019100351259112358, + -0.010367346927523613, + -0.017119329422712326, + -0.021345509216189384, + 0.03278590738773346, + -0.0007083184318616986, + 0.004046649672091007, + -0.0070697711780667305, + 0.0012577424058690667, + 0.033545300364494324, + -0.008675224147737026, + 0.024217989295721054, + 0.04807279258966446, + 0.004147764295339584, + -0.018192382529377937, + -0.00912095420062542, + -0.0393562987446785, + -0.0002057115634670481, + -0.02400337904691696, + 0.011745807714760303, + -0.04886519908905029, + -0.06217106431722641, + -0.05325646698474884, + -0.01659931056201458, + 0.0016508513363078237, + -0.008349181152880192, + -0.03645079955458641, + 0.004973189905285835, + -0.014742102473974228, + 0.035889510065317154, + 0.025373585522174835, + 0.014865917153656483, + -0.0008223303593695164, + -0.015435460023581982, + -0.01684693805873394, + 0.02149408496916294, + 0.012298842892050743, + -0.09944728761911392, + -0.026809826493263245, + 0.07283556461334229, + 0.002156424568966031, + 0.051671646535396576, + 0.01565007120370865, + -0.02489483915269375, + -0.006570388562977314, + -0.0013413167325779796, + -0.003809339599683881, + 0.02157662808895111, + -0.002612472278997302, + -0.009327310137450695, + 0.034007538110017776, + -0.014395424164831638, + -0.01025178749114275, + 0.0651756152510643, + 0.02226998470723629, + -0.038200702518224716, + -0.030639801174402237, + -0.014494474977254868, + -0.011349603533744812, + 0.010656245984137058, + 0.058076951652765274, + -0.06775093823671341, + -0.05289327725768089, + -0.0418325737118721, + 0.016508514061570168, + 0.048502013087272644, + -0.03635174781084061, + 0.008600935339927673, + 0.0014661623863503337, + 0.004952554125338793, + 0.05276121199131012, + -0.007296762894839048, + 0.01574086770415306, + -0.017482515424489975, + -0.0293851550668478, + -0.0032872578594833612, + 0.053322501480579376, + 0.023640191182494164, + -0.004618256818503141, + -0.008972377516329288, + 0.00728438189253211, + 0.012340114451944828, + 0.009847328066825867, + -0.035196151584386826, + -0.014725594781339169, + 0.007465975359082222, + 0.02753620035946369, + 0.01680566743016243, + -0.013949694111943245, + -0.021642660722136497, + 0.027057453989982605, + -0.019744182005524635, + -0.05461016297340393, + -0.011002924293279648, + 0.01733393967151642, + -0.032686855643987656, + -0.03473391383886337, + 0.02284778282046318, + -0.02111438848078251, + -0.04582763463258743, + -0.02099882997572422, + -0.043615493923425674, + -0.025934875011444092, + 0.05903444439172745, + -0.02930261194705963, + 0.07475055009126663, + -0.0007789955125190318, + -0.01845651865005493, + 0.057911865413188934, + -0.02099882997572422, + -0.028014948591589928, + 0.03172936290502548, + -0.005947192199528217, + 0.021642660722136497, + -0.01959560625255108, + 0.012579487636685371, + 0.021956322714686394, + 0.04087508097290993, + 0.06398700177669525, + 0.016417717561125755, + 0.007503119297325611, + 0.028163524344563484, + 0.0035183769650757313, + -0.006438320502638817, + 0.01080482266843319, + -0.04836994409561157, + 0.03225763514637947, + 0.007527882233262062, + 0.02157662808895111, + -0.0642511323094368, + -0.037903547286987305, + -0.014898933470249176, + -0.00017953009228222072, + 0.003702034242451191, + 0.06814714521169662, + -0.0016271204221993685, + 0.023310022428631783, + 0.026760300621390343, + -0.023937344551086426, + 0.0253570768982172, + -0.013272845186293125, + 0.050846222788095474, + 0.019100351259112358, + -0.02099882997572422, + 0.019199401140213013, + 0.014048744924366474, + -0.027833353728055954, + -0.036880020052194595, + -0.007759001571685076, + 0.020685167983174324, + -0.007189457770437002, + 0.02132900059223175, + -0.033264655619859695, + 0.03714415431022644, + 0.02728857286274433, + -0.044936176389455795, + -0.011283569037914276, + 0.006789126433432102, + 0.021873781457543373, + 0.013124268501996994, + -0.0007093502208590508, + 0.01615358144044876, + -0.03496503084897995, + 0.008799037896096706, + 0.0, + -0.01163024827837944, + 0.017532041296362877, + -0.008390451781451702, + 0.03065630979835987, + 0.02472975291311741, + -0.030062003061175346, + 0.007193584926426411, + 0.02207188308238983, + 0.04031379148364067, + 0.04975666105747223, + -0.015270375646650791, + -0.0074701025150716305, + -0.0010926572140306234, + 0.016739632934331894, + -0.008208858780562878, + -0.008799037896096706, + 0.004502696916460991, + 0.0546431802213192, + 0.025654230266809464, + -0.0028704178985208273, + 0.028378134593367577, + 0.004370628856122494, + -0.01148167159408331, + 0.02342558093369007, + 0.027106979861855507, + -0.02309541031718254, + 0.020024826750159264, + -0.026083452627062798, + -0.020932795479893684, + 0.00916222482919693, + -0.0050722407177090645, + 0.007395814172923565, + -0.013157285749912262, + -0.026512673124670982, + -0.0313991941511631, + 0.057185493409633636, + -0.05969478562474251, + -0.007371051236987114, + 0.006929448805749416, + -0.0136607950553298, + 0.004259196575731039, + -0.013347133062779903, + 0.007003737147897482, + -0.004059030674397945, + -0.011473417282104492, + -0.013702066615223885, + -0.034172624349594116, + -0.03306655213236809, + 0.014411932788789272, + -0.0080313915386796, + 0.014709086157381535, + 0.07494865357875824, + 0.0168882105499506, + -0.010086702182888985, + 0.006219582632184029, + 0.020800726488232613, + -0.004267450887709856, + -0.01680566743016243, + 0.011935655027627945, + -0.01705329492688179, + -0.0018355404026806355, + -0.01503925584256649, + 0.06418510526418686, + 0.006289743818342686, + 0.02966579981148243, + 0.04037982597947121, + 0.015394189395010471, + 0.0237557515501976, + 0.0031180456280708313, + 0.05827505514025688, + 0.008353307843208313, + -0.03456882759928703, + -0.012959183193743229, + 0.011126738041639328, + -0.01335538737475872, + -0.03513011708855629, + -0.05606291443109512, + -0.053025346249341965, + 0.009434615261852741, + -0.02444910816848278, + 0.005823378451168537, + 0.02662823349237442, + -0.011811841279268265, + 0.02448212541639805, + -0.017862211912870407, + 0.019463537260890007, + 0.06481242179870605, + -0.046454958617687225, + 0.0041209375485777855, + 0.020784219726920128, + 0.0014733849093317986, + 0.04272403195500374, + -0.035031065344810486, + -0.004535714164376259, + -0.02255062945187092, + -0.008947614580392838, + 0.02276523970067501, + -0.08175016194581985, + 0.02033848874270916, + -0.04084206372499466, + 0.006809761747717857, + -0.08736305683851242, + -0.02715650573372841, + -0.009054919704794884, + 0.0018582396442070603, + 0.022402053698897362, + -0.016838684678077698, + 0.006322760600596666, + 0.030837904661893845, + -0.010606720112264156, + -0.004787468817085028, + -0.01175406202673912, + -0.04648797586560249, + 0.02831210196018219, + 0.014535746537148952, + -0.010887364856898785, + 0.005319868680089712, + 0.00011710727267200127, + 0.004597621038556099, + 0.012538216076791286, + 0.0009342787088826299, + -0.0014362407382577658, + -0.03423865884542465, + -0.06685948371887207, + -0.012868386693298817, + -0.04031379148364067, + -9.402114665135741e-05, + 0.05005381256341934, + 0.0200908612459898, + -0.03479994833469391, + -0.0273711159825325, + 0.024548159912228584, + -0.04434186965227127, + -0.07296763360500336, + -0.011267060413956642, + -0.02560470439493656, + -0.0004441821947693825, + -0.05735057592391968, + 0.02834511734545231, + 0.025489145889878273, + 0.010458143427968025, + 0.018506044521927834, + 0.007602170575410128, + -0.04054490849375725, + -0.012934420257806778, + -0.001360920607112348, + -0.026479655876755714, + -0.015435460023581982, + 0.0273711159825325, + -0.07012816518545151, + -0.003594728885218501, + 0.04810580983757973, + -0.0032026516273617744, + 0.007338034454733133, + -0.012662029825150967, + -0.018836215138435364, + -0.015798646956682205, + 0.05563369020819664, + 0.021180422976613045, + -0.06834524869918823, + 0.03331417962908745, + -0.04995476454496384, + 0.01779617741703987, + 0.05243103951215744, + 0.005505589302629232, + 0.039587415754795074, + 0.030012477189302444, + 0.023194462060928345, + 0.01787872053682804, + -0.02359066531062126, + 0.02809748984873295, + -0.06547276675701141, + -0.04483712464570999, + -0.03938931226730347, + -0.0450352244079113, + -0.04381359741091728, + 0.004853502847254276, + 0.00695421127602458, + -0.008898088708519936, + -0.0028559728525578976, + 0.002255475614219904, + -0.07844845950603485, + 0.0027177140582352877, + -0.013611269183456898, + 0.037408292293548584, + -0.009418107569217682, + -0.0011741680791601539, + -0.04288911819458008, + -0.00010717636905610561, + -0.011960417963564396, + 0.06761886924505234, + -0.04500220715999603, + -0.024383075535297394, + -0.028113998472690582, + -0.018307941034436226, + 0.006702456623315811, + -0.00014793175796512514, + -0.035724423825740814, + 0.013999219983816147, + -0.017036786302924156, + 0.021642660722136497, + 0.019034316763281822, + -0.08023137599229813, + -0.008526647463440895, + -0.016260886564850807, + -0.038035616278648376, + 0.07204315066337585, + -0.014139542356133461, + 0.0325382798910141, + -0.007915832102298737, + 0.031415700912475586, + 0.01738346554338932, + -0.03065630979835987, + 0.002313255565240979, + -0.0005370425642468035, + 0.0007944722310639918, + 0.0011586913606151938, + 0.023409072309732437, + 0.00926953088492155, + 0.02359066531062126 + ], + "result": "--- 结果 1 (相似度: 1.000) ---\n文件路径: C:\\Steam\\steamapps\\common\\RimWorld\\Data\\dll1.6\\Verse\\Map.txt\n\npublic sealed class Map : IIncidentTarget, ILoadReferenceable, IThingHolder, IExposable, IDisposable\n{\n\tpublic MapFileCompressor compressor;\n\n\tprivate List loadedFullThings;\n\n\tpublic MapGeneratorDef generatorDef;\n\n\tpublic int uniqueID = -1;\n\n\tpublic int generationTick;\n\n\tpublic bool wasSpawnedViaGravShipLanding;\n\n\tprivate Color? fogOfWarColor;\n\n\tprivate OrbitalDebrisDef orbitalDebris;\n\n\tprivate int generatedId;\n\n\tpublic MapInfo info = new MapInfo();\n\n\tpublic MapEvents events;\n\n\tpublic List components = new List();\n\n\tpublic ThingOwner spawnedThings;\n\n\tpublic CellIndices cellIndices;\n\n\tpublic ListerThings listerThings;\n\n\tpublic ListerBuildings listerBuildings;\n\n\tpublic MapPawns mapPawns;\n\n\tpublic DynamicDrawManager dynamicDrawManager;\n\n\tpublic MapDrawer mapDrawer;\n\n\tpublic PawnDestinationReservationManager pawnDestinationReservationManager;\n\n\tpublic TooltipGiverList tooltipGiverList;\n\n\tpublic ReservationManager reservationManager;\n\n\tpublic EnrouteManager enrouteManager;\n\n\tpublic PhysicalInteractionReservationManager physicalInteractionReservationManager;\n\n\tpublic DesignationManager designationManager;\n\n\tpublic LordManager lordManager;\n\n\tpublic PassingShipManager passingShipManager;\n\n\tpublic HaulDestinationManager haulDestinationManager;\n\n\tpublic DebugCellDrawer debugDrawer;\n\n\tpublic GameConditionManager gameConditionManager;\n\n\tpublic WeatherManager weatherManager;\n\n\tpublic ZoneManager zoneManager;\n\n\tpublic PlanManager planManager;\n\n\tpublic ResourceCounter resourceCounter;\n\n\tpublic MapTemperature mapTemperature;\n\n\tpublic TemperatureVacuumCache TemperatureVacuumCache;\n\n\tpublic AreaManager areaManager;\n\n\tpublic AttackTargetsCache attackTargetsCache;\n\n\tpublic AttackTargetReservationManager attackTargetReservationManager;\n\n\tpublic VoluntarilyJoinableLordsStarter lordsStarter;\n\n\tpublic FleckManager flecks;\n\n\tpublic DeferredSpawner deferredSpawner;\n\n\tpublic ThingGrid thingGrid;\n\n\tpublic CoverGrid coverGrid;\n\n\tpublic EdificeGrid edificeGrid;\n\n\tpublic BlueprintGrid blueprintGrid;\n\n\tpublic FogGrid fogGrid;\n\n\tpublic RegionGrid regionGrid;\n\n\tpublic GlowGrid glowGrid;\n\n\tpublic TerrainGrid terrainGrid;\n\n\tpublic Pathing pathing;\n\n\tpublic RoofGrid roofGrid;\n\n\tpublic FertilityGrid fertilityGrid;\n\n\tpublic SnowGrid snowGrid;\n\n\tpublic DeepResourceGrid deepResourceGrid;\n\n\tpublic ExitMapGrid exitMapGrid;\n\n\tpublic AvoidGrid avoidGrid;\n\n\tpublic GasGrid gasGrid;\n\n\tpublic PollutionGrid pollutionGrid;\n\n\tpublic SubstructureGrid substructureGrid;\n\n\tpublic WaterBodyTracker waterBodyTracker;\n\n\tpublic SandGrid sandGrid;\n\n\tpublic LinkGrid linkGrid;\n\n\tpublic PowerNetManager powerNetManager;\n\n\tpublic PowerNetGrid powerNetGrid;\n\n\tpublic RegionMaker regionMaker;\n\n\tpublic PathFinder pathFinder;\n\n\tpublic PawnPathPool pawnPathPool;\n\n\tpublic RegionAndRoomUpdater regionAndRoomUpdater;\n\n\tpublic RegionLinkDatabase regionLinkDatabase;\n\n\tpublic MoteCounter moteCounter;\n\n\tpublic GatherSpotLister gatherSpotLister;\n\n\tpublic WindManager windManager;\n\n\tpublic ListerBuildingsRepairable listerBuildingsRepairable;\n\n\tpublic ListerHaulables listerHaulables;\n\n\tpublic ListerMergeables listerMergeables;\n\n\tpublic ListerArtificialBuildingsForMeditation listerArtificialBuildingsForMeditation;\n\n\tpublic ListerBuldingOfDefInProximity listerBuldingOfDefInProximity;\n\n\tpublic ListerBuildingWithTagInProximity listerBuildingWithTagInProximity;\n\n\tpublic ListerFilthInHomeArea listerFilthInHomeArea;\n\n\tpublic Reachability reachability;\n\n\tpublic ItemAvailability itemAvailability;\n\n\tpublic AutoBuildRoofAreaSetter autoBuildRoofAreaSetter;\n\n\tpublic RoofCollapseBufferResolver roofCollapseBufferResolver;\n\n\tpublic RoofCollapseBuffer roofCollapseBuffer;\n\n\tpublic WildAnimalSpawner wildAnimalSpawner;\n\n\tpublic WildPlantSpawner wildPlantSpawner;\n\n\tpublic SteadyEnvironmentEffects steadyEnvironmentEffects;\n\n\tpublic TempTerrainManager tempTerrain;\n\n\tpublic FreezeManager freezeManager;\n\n\tpublic SkyManager skyManager;\n\n\tpublic OverlayDrawer overlayDrawer;\n\n\tpublic FloodFiller floodFiller;\n\n\tpublic WeatherDecider weatherDecider;\n\n\tpublic FireWatcher fireWatcher;\n\n\tpublic DangerWatcher dangerWatcher;\n\n\tpublic DamageWatcher damageWatcher;\n\n\tpublic StrengthWatcher strengthWatcher;\n\n\tpublic WealthWatcher wealthWatcher;\n\n\tpublic RegionDirtyer regionDirtyer;\n\n\tpublic MapCellsInRandomOrder cellsInRandomOrder;\n\n\tpublic RememberedCameraPos rememberedCameraPos;\n\n\tpublic MineStrikeManager mineStrikeManager;\n\n\tpublic StoryState storyState;\n\n\tpublic RoadInfo roadInfo;\n\n\tpublic WaterInfo waterInfo;\n\n\tpublic RetainedCaravanData retainedCaravanData;\n\n\tpublic TemporaryThingDrawer temporaryThingDrawer;\n\n\tpublic AnimalPenManager animalPenManager;\n\n\tpublic MapPlantGrowthRateCalculator plantGrowthRateCalculator;\n\n\tpublic AutoSlaughterManager autoSlaughterManager;\n\n\tpublic TreeDestructionTracker treeDestructionTracker;\n\n\tpublic StorageGroupManager storageGroups;\n\n\tpublic EffecterMaintainer effecterMaintainer;\n\n\tpublic PostTickVisuals postTickVisuals;\n\n\tpublic List layoutStructureSketches = new List();\n\n\tpublic ThingListChangedCallbacks thingListChangedCallbacks = new ThingListChangedCallbacks();\n\n\tpublic List landingBlockers = new List();\n\n\tpublic Tile pocketTileInfo;\n\n\tpublic const string ThingSaveKey = \"thing\";\n\n\t[TweakValue(\"Graphics_Shadow\", 0f, 100f)]\n\tprivate static bool AlwaysRedrawShadows;\n\n\tprivate MixedBiomeMapComponent mixedBiomeComp;\n\n\tpublic int Index => Find.Maps.IndexOf(this);\n\n\tpublic IntVec3 Size => info.Size;\n\n\tpublic IntVec3 Center => new IntVec3(Size.x / 2, 0, Size.z / 2);\n\n\tpublic Faction ParentFaction => info.parent?.Faction;\n\n\tpublic int Area => Size.x * Size.z;\n\n\tpublic IThingHolder ParentHolder => info.parent;\n\n\tpublic bool DrawMapClippers => !generatorDef.disableMapClippers;\n\n\tpublic bool CanEverExit\n\t{\n\t\tget\n\t\t{\n\t\t\tif (!info.isPocketMap)\n\t\t\t{\n\t\t\t\treturn Biome.canExitMap;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tpublic Color? FogOfWarColor\n\t{\n\t\tget\n\t\t{\n\t\t\treturn fogOfWarColor ?? Biome.fogOfWarColor;\n\t\t}\n\t\tset\n\t\t{\n\t\t\tfogOfWarColor = value;\n\t\t}\n\t}\n\n\tpublic OrbitalDebrisDef OrbitalDebris\n\t{\n\t\tget\n\t\t{\n\t\t\treturn orbitalDebris ?? Biome.orbitalDebris;\n\t\t}\n\t\tset\n\t\t{\n\t\t\torbitalDebris = value;\n\t\t}\n\t}\n\n\tpublic Material MapEdgeMaterial\n\t{\n\t\tget\n\t\t{\n\t\t\tif (ModsConfig.AnomalyActive && generatorDef == MapGeneratorDefOf.MetalHell)\n\t\t\t{\n\t\t\t\treturn MapEdgeClipDrawer.ClipMatMetalhell;\n\t\t\t}\n\t\t\tWorldObject parent = Parent;\n\t\t\tif (parent != null && parent.def.MapEdgeMaterial != null)\n\t\t\t{\n\t\t\t\treturn parent.def.MapEdgeMaterial;\n\t\t\t}\n\t\t\treturn MapEdgeClipDrawer.ClipMat;\n\t\t}\n\t}\n\n\tpublic bool Disposed { get; private set; }\n\n\tpublic IEnumerable AllCells\n\t{\n\t\tget\n\t\t{\n\t\t\tfor (int z = 0; z < Size.z; z++)\n\t\t\t{\n\t\t\t\tfor (int y = 0; y < Size.y; y++)\n\t\t\t\t{\n\t\t\t\t\tfor (int x = 0; x < Size.x; x++)\n\t\t\t\t\t{\n\t\t\t\t\t\tyield return new IntVec3(x, y, z);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic bool IsPlayerHome\n\t{\n\t\tget\n\t\t{\n\t\t\tif (!wasSpawnedViaGravShipLanding)\n\t\t\t{\n\t\t\t\tif (info?.parent != null && info.parent.Faction == Faction.OfPlayer)\n\t\t\t\t{\n\t\t\t\t\treturn info.parent.def.canBePlayerHome;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t}\n\n\tpublic bool TreatAsPlayerHomeForThreatPoints\n\t{\n\t\tget\n\t\t{\n\t\t\tif (IsPlayerHome)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif (info.parent != null && info.parent.def.treatAsPlayerHome)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tpublic bool IsTempIncidentMap => info.parent.def.isTempIncidentMapOwner;\n\n\tpublic PlanetTile Tile => info.Tile;\n\n\tpublic Tile TileInfo\n\t{\n\t\tget\n\t\t{\n\t\t\tif (!IsPocketMap)\n\t\t\t{\n\t\t\t\treturn Find.WorldGrid[Tile];\n\t\t\t}\n\t\t\treturn pocketTileInfo;\n\t\t}\n\t}\n\n\tpublic BiomeDef Biome => TileInfo.PrimaryBiome;\n\n\tpublic IEnumerable Biomes => TileInfo.Biomes;\n\n\tpublic MixedBiomeMapComponent MixedBiomeComp => mixedBiomeComp ?? (mixedBiomeComp = GetComponent());\n\n\tpublic bool IsStartingMap => Find.GameInfo.startingTile == Tile;\n\n\tpublic bool IsPocketMap => info.isPocketMap;\n\n\tpublic StoryState StoryState => storyState;\n\n\tpublic GameConditionManager GameConditionManager => gameConditionManager;\n\n\tpublic float PlayerWealthForStoryteller\n\t{\n\t\tget\n\t\t{\n\t\t\tif (TreatAsPlayerHomeForThreatPoints)\n\t\t\t{\n\t\t\t\tif (Find.Storyteller.difficulty.fixedWealthMode)\n\t\t\t\t{\n\t\t\t\t\treturn StorytellerUtility.FixedWealthModeMapWealthFromTimeCurve.Evaluate(AgeInDays * Find.Storyteller.difficulty.fixedWealthTimeFactor);\n\t\t\t\t}\n\t\t\t\treturn wealthWatcher.WealthItems + wealthWatcher.WealthBuildings * 0.5f + wealthWatcher.WealthPawns;\n\t\t\t}\n\t\t\tfloat num = 0f;\n\t\t\tforeach (Pawn item in mapPawns.PawnsInFaction(Faction.OfPlayer))\n\t\t\t{\n\t\t\t\tif (item.IsFreeColonist)\n\t\t\t\t{\n\t\t\t\t\tnum += WealthWatcher.GetEquipmentApparelAndInventoryWealth(item);\n\t\t\t\t}\n\t\t\t\tif (item.IsAnimal)\n\t\t\t\t{\n\t\t\t\t\tnum += item.MarketValue;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn num;\n\t\t}\n\t}\n\n\tpublic IEnumerable PlayerPawnsForStoryteller => mapPawns.PawnsInFaction(Faction.OfPlayer);\n\n\tpublic FloatRange IncidentPointsRandomFactorRange => FloatRange.One;\n\n\tpublic MapParent Parent => info.parent;\n\n\tpublic PocketMapParent PocketMapParent\n\t{\n\t\tget\n\t\t{\n\t\t\tif (!IsPocketMap)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn Parent as PocketMapParent;\n\t\t}\n\t}\n\n\tpublic IEnumerable ChildPocketMaps\n\t{\n\t\tget\n\t\t{\n\t\t\tforeach (PocketMapParent pocketMap in Find.World.pocketMaps)\n\t\t\t{\n\t\t\t\tif (pocketMap.sourceMap == this)\n\t\t\t\t{\n\t\t\t\t\tyield return pocketMap.Map;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic float AgeInDays => (float)(Find.TickManager.TicksGame - generationTick) / 60000f;\n\n\tpublic int NextGenSeed => HashCode.Combine(TileInfo.tile.Valid ? TileInfo.tile.GetHashCode() : uniqueID, generatedId++, Find.World.info.Seed);\n\n\tpublic int ConstantRandSeed => uniqueID ^ 0xFDA252;\n\n\tpublic IEnumerator GetEnumerator()\n\t{\n\t\tforeach (IntVec3 allCell in AllCells)\n\t\t{\n\t\t\tyield return allCell;\n\t\t}\n\t}\n\n\tpublic IEnumerable IncidentTargetTags()\n\t{\n\t\treturn info.parent?.IncidentTargetTags() ?? Enumerable.Empty();\n\t}\n\n\tpublic void ConstructComponents()\n\t{\n\t\tspawnedThings = new ThingOwner(this);\n\t\tcellIndices = new CellIndices(this);\n\t\tlisterThings = new ListerThings(ListerThingsUse.Global, thingListChangedCallbacks);\n\t\tlisterBuildings = new ListerBuildings();\n\t\tmapPawns = new MapPawns(this);\n\t\tdynamicDrawManager = new DynamicDrawManager(this);\n\t\tmapDrawer = new MapDrawer(this);\n\t\ttooltipGiverList = new TooltipGiverList();\n\t\tpawnDestinationReservationManager = new PawnDestinationReservationManager();\n\t\treservationManager = new ReservationManager(this);\n\t\tenrouteManager = new EnrouteManager(this);\n\t\tphysicalInteractionReservationManager = new PhysicalInteractionReservationManager();\n\t\tdesignationManager = new DesignationManager(this);\n\t\tlordManager = new LordManager(this);\n\t\tdebugDrawer = new DebugCellDrawer();\n\t\tpassingShipManager = new PassingShipManager(this);\n\t\thaulDestinationManager = new HaulDestinationManager(this);\n\t\tgameConditionManager = new GameConditionManager(this);\n\t\tweatherManager = new WeatherManager(this);\n\t\tzoneManager = new ZoneManager(this);\n\t\tplanManager = new PlanManager(this);\n\t\tresourceCounter = new ResourceCounter(this);\n\t\tmapTemperature = new MapTemperature(this);\n\t\tTemperatureVacuumCache = new TemperatureVacuumCache(this);\n\t\tareaManager = new AreaManager(this);\n\t\tattackTargetsCache = new AttackTargetsCache(this);\n\t\tattackTargetReservationManager = new AttackTargetReservationManager(this);\n\t\tlordsStarter = new VoluntarilyJoinableLordsStarter(this);\n\t\tflecks = new FleckManager(this);\n\t\tdeferredSpawner = new DeferredSpawner(this);\n\t\tthingGrid = new ThingGrid(this);\n\t\tcoverGrid = new CoverGrid(this);\n\t\tedificeGrid = new EdificeGrid(this);\n\t\tblueprintGrid = new BlueprintGrid(this);\n\t\tfogGrid = new FogGrid(this);\n\t\tglowGrid = new GlowGrid(this);\n\t\tregionGrid = new RegionGrid(this);\n\t\tterrainGrid = new TerrainGrid(this);\n\t\tpathing = new Pathing(this);\n\t\troofGrid = new RoofGrid(this);\n\t\tfertilityGrid = new FertilityGrid(this);\n\t\tsnowGrid = new SnowGrid(this);\n\t\tgasGrid = new GasGrid(this);\n\t\tpollutionGrid = new PollutionGrid(this);\n\t\tdeepResourceGrid = new DeepResourceGrid(this);\n\t\texitMapGrid = new ExitMapGrid(this);\n\t\tavoidGrid = new AvoidGrid(this);\n\t\tlinkGrid = new LinkGrid(this);\n\t\tpowerNetManager = new PowerNetManager(this);\n\t\tpowerNetGrid = new PowerNetGrid(this);\n\t\tregionMaker = new RegionMaker(this);\n\t\tpathFinder = new PathFinder(this);\n\t\tpawnPathPool = new PawnPathPool(this);\n\t\tregionAndRoomUpdater = new RegionAndRoomUpdater(this);\n\t\tregionLinkDatabase = new RegionLinkDatabase();\n\t\tmoteCounter = new MoteCounter();\n\t\tgatherSpotLister = new GatherSpotLister();\n\t\twindManager = new WindManager(this);\n\t\tlisterBuildingsRepairable = new ListerBuildingsRepairable();\n\t\tlisterHaulables = new ListerHaulables(this);\n\t\tlisterMergeables = new ListerMergeables(this);\n\t\tlisterFilthInHomeArea = new ListerFilthInHomeArea(this);\n\t\tlisterArtificialBuildingsForMeditation = new ListerArtificialBuildingsForMeditation(this);\n\t\tlisterBuldingOfDefInProximity = new ListerBuldingOfDefInProximity(this);\n\t\tlisterBuildingWithTagInProximity = new ListerBuildingWithTagInProximity(this);\n\t\treachability = new Reachability(this);\n\t\titemAvailability = new ItemAvailability(this);\n\t\tautoBuildRoofAreaSetter = new AutoBuildRoofAreaSetter(this);\n\t\troofCollapseBufferResolver = new RoofCollapseBufferResolver(this);\n\t\troofCollapseBuffer = new RoofCollapseBuffer();\n\t\twildAnimalSpawner = new WildAnimalSpawner(this);\n\t\twildPlantSpawner = new WildPlantSpawner(this);\n\t\tsteadyEnvironmentEffects = new SteadyEnvironmentEffects(this);\n\t\ttempTerrain = new TempTerrainManager(this);\n\t\tskyManager = new SkyManager(this);\n\t\toverlayDrawer = new OverlayDrawer();\n\t\tfloodFiller = new FloodFiller(this);\n\t\tweatherDecider = new WeatherDecider(this);\n\t\tfireWatcher = new FireWatcher(this);\n\t\tdangerWatcher = new DangerWatcher(this);\n\t\tdamageWatcher = new DamageWatcher();\n\t\tstrengthWatcher = new StrengthWatcher(this);\n\t\twealthWatcher = new WealthWatcher(this);\n\t\tregionDirtyer = new RegionDirtyer(this);\n\t\tcellsInRandomOrder = new MapCellsInRandomOrder(this);\n\t\trememberedCameraPos = new RememberedCameraPos(this);\n\t\tmineStrikeManager = new MineStrikeManager();\n\t\tstoryState = new StoryState(this);\n\t\tretainedCaravanData = new RetainedCaravanData(this);\n\t\ttemporaryThingDrawer = new TemporaryThingDrawer();\n\t\tanimalPenManager = new AnimalPenManager(this);\n\t\tplantGrowthRateCalculator = new MapPlantGrowthRateCalculator();\n\t\tautoSlaughterManager = new AutoSlaughterManager(this);\n\t\ttreeDestructionTracker = new TreeDestructionTracker(this);\n\t\tstorageGroups = new StorageGroupManager(this);\n\t\teffecterMaintainer = new EffecterMaintainer(this);\n\t\tpostTickVisuals = new PostTickVisuals(this);\n\t\tif (ModsConfig.OdysseyActive)\n\t\t{\n\t\t\tsubstructureGrid = new SubstructureGrid(this);\n\t\t\twaterBodyTracker = new WaterBodyTracker(this);\n\t\t\tfreezeManager = new FreezeManager(this);\n\t\t\tsandGrid = new SandGrid(this);\n\t\t}\n\t\tcomponents.Clear();\n\t\tFillComponents();\n\t}\n\n\tpublic void ExposeData()\n\t{\n\t\tif (Scribe.mode == LoadSaveMode.LoadingVars)\n\t\t{\n\t\t\tevents = new MapEvents(this);\n\t\t}\n\t\tScribe_Values.Look(ref uniqueID, \"uniqueID\", -1);\n\t\tScribe_Values.Look(ref generationTick, \"generationTick\", 0);\n\t\tScribe_Values.Look(ref wasSpawnedViaGravShipLanding, \"wasSpawnedViaGravShipLanding\", defaultValue: false);\n\t\tScribe_Values.Look(ref fogOfWarColor, \"fogOfWarColor\");\n\t\tScribe_Values.Look(ref generatedId, \"generatedId\", 0);\n\t\tScribe_Defs.Look(ref orbitalDebris, \"orbitalDebris\");\n\t\tScribe_Defs.Look(ref generatorDef, \"generatorDef\");\n\t\tScribe_Deep.Look(ref pocketTileInfo, \"pocketTileInfo\");\n\t\tScribe_Deep.Look(ref info, \"mapInfo\");\n\t\tScribe_Collections.Look(ref layoutStructureSketches, \"layoutStructureSketches\", LookMode.Deep);\n\t\tScribe_Collections.Look(ref landingBlockers, \"landingBlockers\", LookMode.Undefined);\n\t\tif (Scribe.mode == LoadSaveMode.Saving)\n\t\t{\n\t\t\tcompressor = new MapFileCompressor(this);\n\t\t\tcompressor.BuildCompressedString();\n\t\t\tExposeComponents();\n\t\t\tcompressor.ExposeData();\n\t\t\tHashSet hashSet = new HashSet();\n\t\t\tif (Scribe.EnterNode(\"things\"))\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tforeach (Thing allThing in listerThings.AllThings)\n\t\t\t\t\t{\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (allThing.def.isSaveable && !allThing.IsSaveCompressible())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (!hashSet.Add(allThing.ThingID))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tLog.Error(\"Saving Thing with already-used ID \" + allThing.ThingID);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\thashSet.Add(allThing.ThingID);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tThing target = allThing;\n\t\t\t\t\t\t\t\tScribe_Deep.Look(ref target, \"thing\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch (OutOfMemoryException)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthrow;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch (Exception arg)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tLog.Error($\"Exception saving {allThing}: {arg}\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfinally\n\t\t\t\t{\n\t\t\t\t\tScribe.ExitNode();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tLog.Error(\"Could not enter the things node while saving.\");\n\t\t\t}\n\t\t\tcompressor = null;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (Scribe.mode == LoadSaveMode.LoadingVars)\n\t\t\t{\n\t\t\t\tConstructComponents();\n\t\t\t\tregionAndRoomUpdater.Enabled = false;\n\t\t\t\tcompressor = new MapFileCompressor(this);\n\t\t\t}\n\t\t\telse if (Scribe.mode == LoadSaveMode.PostLoadInit && landingBlockers == null)\n\t\t\t{\n\t\t\t\tlandingBlockers = new List();\n\t\t\t}\n\t\t\tExposeComponents();\n\t\t\tDeepProfiler.Start(\"Load compressed things\");\n\t\t\tcompressor.ExposeData();\n\t\t\tDeepProfiler.End();\n\t\t\tDeepProfiler.Start(\"Load non-compressed things\");\n\t\t\tScribe_Collections.Look(ref loadedFullThings, \"things\", LookMode.Deep);\n\t\t\tDeepProfiler.End();\n\t\t}\n\t\tBackCompatibility.PostExposeData(this);\n\t}\n\n\tprivate void FillComponents()\n\t{\n\t\tcomponents.RemoveAll((MapComponent component) => component == null);\n\t\tforeach (Type item3 in typeof(MapComponent).AllSubclassesNonAbstract())\n\t\t{\n\t\t\tif (!typeof(CustomMapComponent).IsAssignableFrom(item3) && GetComponent(item3) == null)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tMapComponent item = (MapComponent)Activator.CreateInstance(item3, this);\n\t\t\t\t\tcomponents.Add(item);\n\t\t\t\t}\n\t\t\t\tcatch (Exception ex)\n\t\t\t\t{\n\t\t\t\t\tLog.Error(\"Could not instantiate a MapComponent of type \" + item3?.ToString() + \": \" + ex);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (generatorDef?.customMapComponents != null)\n\t\t{\n\t\t\tforeach (Type customMapComponent in generatorDef.customMapComponents)\n\t\t\t{\n\t\t\t\tif (GetComponent(customMapComponent) == null)\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tMapComponent item2 = (MapComponent)Activator.CreateInstance(customMapComponent, this);\n\t\t\t\t\t\tcomponents.Add(item2);\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Exception ex2)\n\t\t\t\t\t{\n\t\t\t\t\t\tLog.Error(\"Could not instantiate a MapComponent of type \" + customMapComponent?.ToString() + \": \" + ex2);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\troadInfo = GetComponent();\n\t\twaterInfo = GetComponent();\n\t}\n\n\tpublic void FinalizeLoading()\n\t{\n\t\tregionAndRoomUpdater.Enabled = true;\n\t\tList list = compressor.ThingsToSpawnAfterLoad().ToList();\n\t\tcompressor = null;\n\t\tDeepProfiler.Start(\"Merge compressed and non-compressed thing lists\");\n\t\tList list2 = new List(loadedFullThings.Count + list.Count);\n\t\tforeach (Thing item in loadedFullThings.Concat(list))\n\t\t{\n\t\t\tlist2.Add(item);\n\t\t}\n\t\tloadedFullThings.Clear();\n\t\tDeepProfiler.End();\n\t\tDeepProfiler.Start(\"Spawn everything into the map\");\n\t\tBackCompatibility.PreCheckSpawnBackCompatibleThingAfterLoading(this);\n\t\tforeach (Thing item2 in list2)\n\t\t{\n\t\t\tif (item2 is Building)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif (!BackCompatibility.CheckSpawnBackCompatibleThingAfterLoading(item2, this))\n\t\t\t\t{\n\t\t\t\t\tGenSpawn.Spawn(item2, item2.Position, this, item2.Rotation, WipeMode.FullRefund, respawningAfterLoad: true);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (Exception ex)\n\t\t\t{\n\t\t\t\tLog.Error(\"Exception spawning loaded thing \" + item2.ToStringSafe() + \": \" + ex);\n\t\t\t}\n\t\t}\n\t\tforeach (Building item3 in from t in list2.OfType()\n\t\t\torderby t.def.size.Magnitude\n\t\t\tselect t)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tGenSpawn.SpawnBuildingAsPossible(item3, this, respawningAfterLoad: true);\n\t\t\t}\n\t\t\tcatch (Exception ex2)\n\t\t\t{\n\t\t\t\tLog.Error(\"Exception spawning loaded thing \" + item3.ToStringSafe() + \": \" + ex2);\n\t\t\t}\n\t\t}\n\t\tBackCompatibility.PostCheckSpawnBackCompatibleThingAfterLoading(this);\n\t\tDeepProfiler.End();\n\t\tFinalizeInit();\n\t}\n\n\tpublic void FinalizeInit()\n\t{\n\t\tDeepProfiler.Start(\"Finalize geometry\");\n\t\tpathing.RecalculateAllPerceivedPathCosts();\n\t\tregionAndRoomUpdater.Enabled = true;\n\t\tregionAndRoomUpdater.RebuildAllRegionsAndRooms();\n\t\tpowerNetManager.UpdatePowerNetsAndConnections_First();\n\t\tTemperatureVacuumCache.TemperatureVacuumSaveLoad.ApplyLoadedDataToRegions();\n\t\tavoidGrid.Regenerate();\n\t\tanimalPenManager.RebuildAllPens();\n\t\tplantGrowthRateCalculator.BuildFor(this);\n\t\tgasGrid.RecalculateEverHadGas();\n\t\tDeepProfiler.End();\n\t\tDeepProfiler.Start(\"Thing.PostMapInit()\");\n\t\tforeach (Thing item in listerThings.AllThings.ToList())\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\titem.PostMapInit();\n\t\t\t}\n\t\t\tcatch (Exception ex)\n\t\t\t{\n\t\t\t\tLog.Error(\"Error in PostMapInit() for \" + item.ToStringSafe() + \": \" + ex);\n\t\t\t}\n\t\t}\n\t\tDeepProfiler.End();\n\t\tDeepProfiler.Start(\"listerFilthInHomeArea.RebuildAll()\");\n\t\tlisterFilthInHomeArea.RebuildAll();\n\t\tDeepProfiler.End();\n\t\tif (ModsConfig.OdysseyActive)\n\t\t{\n\t\t\tGetComponent().SetDrawerDirty();\n\t\t}\n\t\tLongEventHandler.ExecuteWhenFinished(delegate\n\t\t{\n\t\t\tmapDrawer.RegenerateEverythingNow();\n\t\t});\n\t\tDeepProfiler.Start(\"resourceCounter.UpdateResourceCounts()\");\n\t\tresourceCounter.UpdateResourceCounts();\n\t\tDeepProfiler.End();\n\t\tDeepProfiler.Start(\"wealthWatcher.ForceRecount()\");\n\t\twealthWatcher.ForceRecount(allowDuringInit: true);\n\t\tDeepProfiler.End();\n\t\tif (ModsConfig.OdysseyActive)\n\t\t{\n\t\t\tusing (new ProfilerBlock(\"WaterBodyTracker.ConstructBodies()\"))\n\t\t\t{\n\t\t\t\twaterBodyTracker?.ConstructBodies();\n\t\t\t}\n\t\t}\n\t\tMapComponentUtility.FinalizeInit(this);\n\t\tLongEventHandler.ExecuteWhenFinished(delegate\n\t\t{\n\t\t\tFind.MusicManagerPlay.CheckTransitions();\n\t\t});\n\t}\n\n\tprivate void ExposeComponents()\n\t{\n\t\tScribe_Deep.Look(ref weatherManager, \"weatherManager\", this);\n\t\tScribe_Deep.Look(ref reservationManager, \"reservationManager\", this);\n\t\tScribe_Deep.Look(ref enrouteManager, \"enrouteManager\", this);\n\t\tScribe_Deep.Look(ref physicalInteractionReservationManager, \"physicalInteractionReservationManager\");\n\t\tScribe_Deep.Look(ref planManager, \"planManager\", this);\n\t\tScribe_Deep.Look(ref designationManager, \"designationManager\", this);\n\t\tScribe_Deep.Look(ref pawnDestinationReservationManager, \"pawnDestinationReservationManager\");\n\t\tScribe_Deep.Look(ref lordManager, \"lordManager\", this);\n\t\tScribe_Deep.Look(ref passingShipManager, \"visitorManager\", this);\n\t\tScribe_Deep.Look(ref gameConditionManager, \"gameConditionManager\", this);\n\t\tScribe_Deep.Look(ref fogGrid, \"fogGrid\", this);\n\t\tScribe_Deep.Look(ref roofGrid, \"roofGrid\", this);\n\t\tScribe_Deep.Look(ref terrainGrid, \"terrainGrid\", this);\n\t\tScribe_Deep.Look(ref zoneManager, \"zoneManager\", this);\n\t\tScribe_Deep.Look(ref TemperatureVacuumCache, \"temperatureCache\", this);\n\t\tScribe_Deep.Look(ref snowGrid, \"snowGrid\", this);\n\t\tScribe_Deep.Look(ref gasGrid, \"gasGrid\", this);\n\t\tScribe_Deep.Look(ref pollutionGrid, \"pollutionGrid\", this);\n\t\tScribe_Deep.Look(ref waterBodyTracker, \"waterBodyTracker\", this);\n\t\tScribe_Deep.Look(ref areaManager, \"areaManager\", this);\n\t\tScribe_Deep.Look(ref lordsStarter, \"lordsStarter\", this);\n\t\tScribe_Deep.Look(ref attackTargetReservationManager, \"attackTargetReservationManager\", this);\n\t\tScribe_Deep.Look(ref deepResourceGrid, \"deepResourceGrid\", this);\n\t\tScribe_Deep.Look(ref weatherDecider, \"weatherDecider\", this);\n\t\tScribe_Deep.Look(ref damageWatcher, \"damageWatcher\");\n\t\tScribe_Deep.Look(ref rememberedCameraPos, \"rememberedCameraPos\", this);\n\t\tScribe_Deep.Look(ref mineStrikeManager, \"mineStrikeManager\");\n\t\tScribe_Deep.Look(ref retainedCaravanData, \"retainedCaravanData\", this);\n\t\tScribe_Deep.Look(ref storyState, \"storyState\", this);\n\t\tScribe_Deep.Look(ref tempTerrain, \"tempTerrain\", this);\n\t\tScribe_Deep.Look(ref wildPlantSpawner, \"wildPlantSpawner\", this);\n\t\tScribe_Deep.Look(ref temporaryThingDrawer, \"temporaryThingDrawer\");\n\t\tScribe_Deep.Look(ref flecks, \"flecks\", this);\n\t\tScribe_Deep.Look(ref deferredSpawner, \"deferredSpawner\", this);\n\t\tScribe_Deep.Look(ref autoSlaughterManager, \"autoSlaughterManager\", this);\n\t\tScribe_Deep.Look(ref treeDestructionTracker, \"treeDestructionTracker\", this);\n\t\tScribe_Deep.Look(ref storageGroups, \"storageGroups\", this);\n\t\tScribe_Deep.Look(ref sandGrid, \"sandGrid\", this);\n\t\tScribe_Collections.Look(ref components, \"components\", LookMode.Deep, this);\n\t\tif (Scribe.mode == LoadSaveMode.PostLoadInit)\n\t\t{\n\t\t\tif (planManager == null)\n\t\t\t{\n\t\t\t\tplanManager = new PlanManager(this);\n\t\t\t}\n\t\t\tif (ModsConfig.BiotechActive && pollutionGrid == null)\n\t\t\t{\n\t\t\t\tpollutionGrid = new PollutionGrid(this);\n\t\t\t}\n\t\t\tif (ModsConfig.OdysseyActive)\n\t\t\t{\n\t\t\t\tif (sandGrid == null)\n\t\t\t\t{\n\t\t\t\t\tsandGrid = new SandGrid(this);\n\t\t\t\t}\n\t\t\t\tif (substructureGrid == null)\n\t\t\t\t{\n\t\t\t\t\tsubstructureGrid = new SubstructureGrid(this);\n\t\t\t\t}\n\t\t\t\tif (waterBodyTracker == null)\n\t\t\t\t{\n\t\t\t\t\twaterBodyTracker = new WaterBodyTracker(this);\n\t\t\t\t}\n\t\t\t\tif (freezeManager == null)\n\t\t\t\t{\n\t\t\t\t\tfreezeManager = new FreezeManager(this);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tFillComponents();\n\t\tBackCompatibility.PostExposeData(this);\n\t}\n\n\tpublic void MapPreTick()\n\t{\n\t\titemAvailability.Tick();\n\t\tlisterHaulables.ListerHaulablesTick();\n\t\ttry\n\t\t{\n\t\t\tautoBuildRoofAreaSetter.AutoBuildRoofAreaSetterTick_First();\n\t\t}\n\t\tcatch (Exception ex)\n\t\t{\n\t\t\tLog.Error(ex.ToString());\n\t\t}\n\t\troofCollapseBufferResolver.CollapseRoofsMarkedToCollapse();\n\t\twindManager.WindManagerTick();\n\t\ttry\n\t\t{\n\t\t\tmapTemperature.MapTemperatureTick();\n\t\t}\n\t\tcatch (Exception ex2)\n\t\t{\n\t\t\tLog.Error(ex2.ToString());\n\t\t}\n\t\ttemporaryThingDrawer.Tick();\n\t\ttry\n\t\t{\n\t\t\tpathFinder.PathFinderTick();\n\t\t}\n\t\tcatch (Exception ex3)\n\t\t{\n\t\t\tLog.Error(ex3.ToString());\n\t\t}\n\t}\n\n\tpublic void MapPostTick()\n\t{\n\t\ttry\n\t\t{\n\t\t\twildAnimalSpawner.WildAnimalSpawnerTick();\n\t\t}\n\t\tcatch (Exception ex)\n\t\t{\n\t\t\tLog.Error(ex.ToString());\n\t\t}\n\t\ttry\n\t\t{\n\t\t\twildPlantSpawner.WildPlantSpawnerTick();\n\t\t}\n\t\tcatch (Exception ex2)\n\t\t{\n\t\t\tLog.Error(ex2.ToString());\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tpowerNetManager.PowerNetsTick();\n\t\t}\n\t\tcatch (Exception ex3)\n\t\t{\n\t\t\tLog.Error(ex3.ToString());\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tsteadyEnvironmentEffects.SteadyEnvironmentEffectsTick();\n\t\t}\n\t\tcatch (Exception ex4)\n\t\t{\n\t\t\tLog.Error(ex4.ToString());\n\t\t}\n\t\ttry\n\t\t{\n\t\t\ttempTerrain.Tick();\n\t\t}\n\t\tcatch (Exception ex5)\n\t\t{\n\t\t\tLog.Error(ex5.ToString());\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tgasGrid.Tick();\n\t\t}\n\t\tcatch (Exception ex6)\n\t\t{\n\t\t\tLog.Error(ex6.ToString());\n\t\t}\n\t\tif (ModsConfig.BiotechActive)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tpollutionGrid.PollutionTick();\n\t\t\t}\n\t\t\tcatch (Exception ex7)\n\t\t\t{\n\t\t\t\tLog.Error(ex7.ToString());\n\t\t\t}\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tdeferredSpawner.DeferredSpawnerTick();\n\t\t}\n\t\tcatch (Exception ex8)\n\t\t{\n\t\t\tLog.Error(ex8.ToString());\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tlordManager.LordManagerTick();\n\t\t}\n\t\tcatch (Exception ex9)\n\t\t{\n\t\t\tLog.Error(ex9.ToString());\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tpassingShipManager.PassingShipManagerTick();\n\t\t}\n\t\tcatch (Exception ex10)\n\t\t{\n\t\t\tLog.Error(ex10.ToString());\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tdebugDrawer.DebugDrawerTick();\n\t\t}\n\t\tcatch (Exception ex11)\n\t\t{\n\t\t\tLog.Error(ex11.ToString());\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tlordsStarter.VoluntarilyJoinableLordsStarterTick();\n\t\t}\n\t\tcatch (Exception ex12)\n\t\t{\n\t\t\tLog.Error(ex12.ToString());\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tgameConditionManager.GameConditionManagerTick();\n\t\t}\n\t\tcatch (Exception ex13)\n\t\t{\n\t\t\tLog.Error(ex13.ToString());\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tweatherManager.WeatherManagerTick();\n\t\t}\n\t\tcatch (Exception ex14)\n\t\t{\n\t\t\tLog.Error(ex14.ToString());\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tresourceCounter.ResourceCounterTick();\n\t\t}\n\t\tcatch (Exception ex15)\n\t\t{\n\t\t\tLog.Error(ex15.ToString());\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tweatherDecider.WeatherDeciderTick();\n\t\t}\n\t\tcatch (Exception ex16)\n\t\t{\n\t\t\tLog.Error(ex16.ToString());\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tfireWatcher.FireWatcherTick();\n\t\t}\n\t\tcatch (Exception ex17)\n\t\t{\n\t\t\tLog.Error(ex17.ToString());\n\t\t}\n\t\tif (ModsConfig.OdysseyActive)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\twaterBodyTracker?.Tick();\n\t\t\t}\n\t\t\tcatch (Exception ex18)\n\t\t\t{\n\t\t\t\tLog.Error(ex18.ToString());\n\t\t\t}\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tflecks.FleckManagerTick();\n\t\t}\n\t\tcatch (Exception ex19)\n\t\t{\n\t\t\tLog.Error(ex19.ToString());\n\t\t}\n\t\ttry\n\t\t{\n\t\t\teffecterMaintainer.EffecterMaintainerTick();\n\t\t}\n\t\tcatch (Exception ex20)\n\t\t{\n\t\t\tLog.Error(ex20.ToString());\n\t\t}\n\t\tMapComponentUtility.MapComponentTick(this);\n\t\ttry\n\t\t{\n\t\t\tforeach (TileMutatorDef mutator in TileInfo.Mutators)\n\t\t\t{\n\t\t\t\tmutator.Worker?.Tick(this);\n\t\t\t}\n\t\t}\n\t\tcatch (Exception ex21)\n\t\t{\n\t\t\tLog.Error(ex21.ToString());\n\t\t}\n\t}\n\n\tpublic void MapUpdate()\n\t{\n\t\tif (Disposed)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\tbool drawingMap = WorldRendererUtility.DrawingMap;\n\t\tskyManager.SkyManagerUpdate();\n\t\tpowerNetManager.UpdatePowerNetsAndConnections_First();\n\t\tregionGrid.UpdateClean();\n\t\tregionAndRoomUpdater.TryRebuildDirtyRegionsAndRooms();\n\t\tglowGrid.GlowGridUpdate_First();\n\t\tlordManager.LordManagerUpdate();\n\t\tpostTickVisuals.ProcessPostTickVisuals();\n\t\tif (drawingMap && Find.CurrentMap == this)\n\t\t{\n\t\t\tif (AlwaysRedrawShadows)\n\t\t\t{\n\t\t\t\tmapDrawer.WholeMapChanged(MapMeshFlagDefOf.Things);\n\t\t\t}\n\t\t\tGlobalRendererUtility.UpdateGlobalShadersParams();\n\t\t\tPlantFallColors.SetFallShaderGlobals(this);\n\t\t\twaterInfo.SetTextures();\n\t\t\tavoidGrid.DebugDrawOnMap();\n\t\t\tBreachingGridDebug.DebugDrawAllOnMap(this);\n\t\t\tmapDrawer.MapMeshDrawerUpdate_First();\n\t\t\tpowerNetGrid.DrawDebugPowerNetGrid();\n\t\t\tDoorsDebugDrawer.DrawDebug();\n\t\t\tmapDrawer.DrawMapMesh();\n\t\t\tdynamicDrawManager.DrawDynamicThings();\n\t\t\tgameConditionManager.GameConditionManagerDraw(this);\n\t\t\tMapEdgeClipDrawer.DrawClippers(this);\n\t\t\tdesignationManager.DrawDesignations();\n\t\t\toverlayDrawer.DrawAllOverlays();\n\t\t\ttemporaryThingDrawer.Draw();\n\t\t\tflecks.FleckManagerDraw();\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tareaManager.AreaManagerUpdate();\n\t\t}\n\t\tcatch (Exception ex)\n\t\t{\n\t\t\tLog.Error(ex.ToString());\n\t\t}\n\t\tweatherManager.WeatherManagerUpdate();\n\t\ttry\n\t\t{\n\t\t\tflecks.FleckManagerUpdate();\n\t\t}\n\t\tcatch (Exception ex2)\n\t\t{\n\t\t\tLog.Error(ex2.ToString());\n\t\t}\n\t\tMapComponentUtility.MapComponentUpdate(this);\n\t}\n\n\tpublic T GetComponent() where T : MapComponent\n\t{\n\t\tfor (int i = 0; i < components.Count; i++)\n\t\t{\n\t\t\tif (components[i] is T result)\n\t\t\t{\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic MapComponent GetComponent(Type type)\n\t{\n\t\tfor (int i = 0; i < components.Count; i++)\n\t\t{\n\t\t\tif (type.IsInstanceOfType(components[i]))\n\t\t\t{\n\t\t\t\treturn components[i];\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic void MapOnGUI()\n\t{\n\t\tDevGUISketches();\n\t\tDevRoadPaths();\n\t\tpathFinder.OnGUI();\n\t}\n\n\tprivate static void DevRoadPaths()\n\t{\n\t\tif (!DebugViewSettings.drawRoadPaths)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\tfor (int i = 0; i < GenStep_Roads.paths.Count; i++)\n\t\t{\n\t\t\tforeach (IntVec3 item in GenStep_Roads.paths[i])\n\t\t\t{\n\t\t\t\tVector2 vector = item.ToVector3Shifted().MapToUIPosition();\n\t\t\t\tDevGUI.DrawRect(new Rect(vector.x, vector.y, 5f, 5f), (i % 2 == 0) ? Color.yellow : Color.blue);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate void DevGUISketches()\n\t{\n\t\tif ((!DebugViewSettings.drawMapGraphs && !DebugViewSettings.drawMapRooms) || layoutStructureSketches.NullOrEmpty())\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\tforeach (LayoutStructureSketch layoutStructureSketch in layoutStructureSketches)\n\t\t{\n\t\t\tDebugGUILayoutStructure(layoutStructureSketch);\n\t\t}\n\t}\n\n\tprivate void DebugGUILayoutStructure(LayoutStructureSketch layoutStructureSketch)\n\t{\n\t\tDevDrawOutline(layoutStructureSketch.structureLayout.container, Color.yellow);\n\t\tVector2 pos = (layoutStructureSketch.structureLayout.container.Min - IntVec3.South).ToVector3().MapToUIPosition();\n\t\tDevDrawLabel(layoutStructureSketch.layoutDef.defName, pos);\n\t\tif (DebugViewSettings.drawMapGraphs && layoutStructureSketch.structureLayout?.neighbours != null)\n\t\t{\n\t\t\tforeach (KeyValuePair> connection in layoutStructureSketch.structureLayout.neighbours.connections)\n\t\t\t{\n\t\t\t\tforeach (Vector2 item in connection.Value)\n\t\t\t\t{\n\t\t\t\t\tVector2 vector = layoutStructureSketch.center.ToVector2();\n\t\t\t\t\tVector2 vector2 = vector + connection.Key;\n\t\t\t\t\tVector2 vector3 = vector + item;\n\t\t\t\t\tVector2 start = new Vector3(vector2.x, 0f, vector2.y).MapToUIPosition();\n\t\t\t\t\tVector2 end = new Vector3(vector3.x, 0f, vector3.y).MapToUIPosition();\n\t\t\t\t\tDevGUI.DrawLine(start, end, Color.green, 2f);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (!DebugViewSettings.drawMapRooms || layoutStructureSketch.structureLayout?.Rooms == null)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\tforeach (LayoutRoom room in layoutStructureSketch.structureLayout.Rooms)\n\t\t{\n\t\t\tstring name = \"NA\";\n\t\t\tif (!room.defs.NullOrEmpty())\n\t\t\t{\n\t\t\t\tname = room.defs.Select((LayoutRoomDef x) => x.defName).ToCommaList();\n\t\t\t}\n\t\t\tDevDrawLabel(name, room.rects[0].CenterVector3.MapToUIPosition());\n\t\t\tforeach (CellRect rect in room.rects)\n\t\t\t{\n\t\t\t\tDevDrawOutline(rect, Color.blue);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate static void DevDrawLabel(string name, Vector2 pos)\n\t{\n\t\tfloat widthCached = name.GetWidthCached();\n\t\tDevGUI.Label(new Rect(pos.x - widthCached / 2f, pos.y, widthCached, 20f), name);\n\t}\n\n\tprivate static void DevDrawOutline(CellRect r, Color color)\n\t{\n\t\tIntVec3 min = r.Min;\n\t\tIntVec3 intVec = r.Max + new IntVec3(1, 0, 1);\n\t\tIntVec3 a = new IntVec3(min.x, 0, min.z);\n\t\tIntVec3 intVec2 = new IntVec3(intVec.x, 0, min.z);\n\t\tIntVec3 intVec3 = new IntVec3(min.x, 0, intVec.z);\n\t\tIntVec3 b = new IntVec3(intVec.x, 0, intVec.z);\n\t\tDevDrawLine(a, intVec2, color);\n\t\tDevDrawLine(a, intVec3, color);\n\t\tDevDrawLine(intVec3, b, color);\n\t\tDevDrawLine(intVec2, b, color);\n\t}\n\n\tprivate static void DevDrawLine(IntVec3 a, IntVec3 b, Color color)\n\t{\n\t\tVector2 start = a.ToVector3().MapToUIPosition();\n\t\tVector2 end = b.ToVector3().MapToUIPosition();\n\t\tDevGUI.DrawLine(start, end, color, 2f);\n\t}\n\n\tpublic string GetUniqueLoadID()\n\t{\n\t\treturn \"Map_\" + uniqueID;\n\t}\n\n\tpublic override string ToString()\n\t{\n\t\tstring text = \"Map-\" + uniqueID;\n\t\tif (IsPlayerHome)\n\t\t{\n\t\t\ttext += \"-PlayerHome\";\n\t\t}\n\t\treturn text;\n\t}\n\n\tpublic ThingOwner GetDirectlyHeldThings()\n\t{\n\t\treturn spawnedThings;\n\t}\n\n\tpublic void GetChildHolders(List outChildren)\n\t{\n\t\tThingOwnerUtility.AppendThingHoldersFromThings(outChildren, listerThings.ThingsInGroup(ThingRequestGroup.ThingHolder));\n\t\tList passingShips = passingShipManager.passingShips;\n\t\tfor (int i = 0; i < passingShips.Count; i++)\n\t\t{\n\t\t\tif (passingShips[i] is IThingHolder item)\n\t\t\t{\n\t\t\t\toutChildren.Add(item);\n\t\t\t}\n\t\t}\n\t\tfor (int j = 0; j < components.Count; j++)\n\t\t{\n\t\t\tif (components[j] is IThingHolder item2)\n\t\t\t{\n\t\t\t\toutChildren.Add(item2);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic void Dispose()\n\t{\n\t\tif (Disposed)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\tDisposed = true;\n\t\tforeach (MapComponent component in components)\n\t\t{\n\t\t\tif (component is IDisposable disposable)\n\t\t\t{\n\t\t\t\tdisposable.Dispose();\n\t\t\t}\n\t\t}\n\t\tif (regionAndRoomUpdater != null)\n\t\t{\n\t\t\tregionAndRoomUpdater.Enabled = false;\n\t\t}\n\t\tpathFinder?.Dispose();\n\t\tlordManager?.Dispose();\n\t\tfogGrid?.Dispose();\n\t\tsnowGrid?.Dispose();\n\t\tglowGrid?.Dispose();\n\t\tsandGrid?.Dispose();\n\t\tavoidGrid?.Dispose();\n\t\tlisterBuildings?.Dispose();\n\t\tlisterThings?.Clear();\n\t\tregionDirtyer?.SetAllDirty();\n\t\tregionGrid?.Dispose();\n\t\tpathing?.Dispose();\n\t\tmapDrawer?.Dispose();\n\t\tResources.UnloadUnusedAssets();\n\t\tMapGenerator.ClearDebugMode();\n\t}\n}\n\n", + "timestamp": "2025-08-25 11:41:03,392" } } \ No newline at end of file diff --git a/Source/ProjectDocumentation/ArmedPocketShuttle_DesignDocument.md b/Source/ProjectDocumentation/ArmedPocketShuttle_DesignDocument.md new file mode 100644 index 00000000..bd41a7f0 --- /dev/null +++ b/Source/ProjectDocumentation/ArmedPocketShuttle_DesignDocument.md @@ -0,0 +1,109 @@ +# 武装口袋穿梭机 (Armed Pocket Shuttle) - 设计文档 + +## 1. 项目概述 + +**目标**:重新设计并实现一个《边缘世界》(RimWorld) 的Mod,引入一种具备武装能力和内部“口袋空间”的特殊穿梭机。该穿梭机将解决现有实现中存在的顽固bug,并提供更稳定、更灵活的游戏体验。 + +**核心问题**:现有 `Building_ArmedShuttleWithPocket.cs` 的实现尝试过度模仿原版 `MapPortal` 的内部机制,导致代码复杂且难以调试和维护,最终陷入无法修复的bug。 + +**解决方案理念**: +* **放弃现有问题代码**:彻底废弃当前 `Building_ArmedShuttleWithPocket.cs` 中导致bug的复杂逻辑。 +* **回归原版基础**:以 `Building_PassengerShuttle` 为基类,利用其成熟的运输和组件系统。 +* **组合与委托**:通过组合而非直接继承或深度模仿的方式,将 `MapPortal` 的概念融入到新穿梭机中,实现口袋空间功能。 +* **职责分离**:明确区分穿梭机本体(武装、飞行、外部运输)和口袋空间(内部地图、内部传送)的职责。 + +## 2. 核心设计思路 + +### 2.1 穿梭机本体 (`Building_ArmedShuttleWithPocket` - 新版) + +* **继承**: `Building_ArmedShuttleWithPocket` 将继承 `Building_ArmedShuttle`,从而自然继承了武装能力和 `Building_PassengerShuttle` 的所有基础功能,包括 `CompTransporter` 和 `CompShuttle` 组件。 +* **唯一容器**: 穿梭机自身的 `CompTransporter` 将是唯一且权威的物品和人员容器。所有装载操作都将首先将物品和人员放入这个 `CompTransporter` 的 `innerContainer`。 +* **武装能力**:通过继承 `Building_ArmedShuttle`,穿梭机将保留其炮塔和攻击逻辑。 + +### 2.2 口袋空间实现 + +口袋空间将是一个独立生成的 `Map` 实例,通过 `PocketMapUtility` 进行管理。 + +* **内部地图 (`pocketMap`)**: `Building_ArmedShuttleWithPocket` 将持有一个 `Map` 类型的私有字段 `pocketMap`,代表内部空间。 +* **地图生成**: + * 口袋地图的生成将通过 `CreatePocketMap()` 方法触发,该方法会调用 `PocketMapUtility.GeneratePocketMap()`。 + * 地图的尺寸 (`pocketMapSize`)、生成器 (`mapGenerator`) 和出口定义 (`exitDef`) 将通过 `PocketMapProperties` (`DefModExtension`) 从XML配置中获取。 + * 生成后,会在口袋地图的特定位置放置一个 `Building_PocketMapExit` 实例,作为进出内部空间的唯一通道。 +* **人员/物品进出**: + * **从主地图进入口袋空间**: + * 人员:通过 `EnterPocketSpace(IEnumerable pawns)` 方法,将选定的小人从主地图传送到口袋地图的指定位置(例如出口附近)。 + * 物品:物品将首先通过穿梭机的 `CompTransporter` 装载。 + * **从口袋空间返回主地图**: 通过 `Building_PocketMapExit` 来实现,它将负责将口袋空间内的物品和人员传送到主地图的穿梭机位置。 +* **内部物品管理**: 口袋地图内的物品将直接作为地图上的 `Thing` 存在,而不是由穿梭机本体的 `CompTransporter` 直接管理。当穿梭机被销毁时,口袋地图内的所有物品和人员将被安全地转移回主地图的穿梭机位置。 + +### 2.3 装载机制 (`GetGizmos` 重构) + +`Building_ArmedShuttleWithPocket` 的 `GetGizmos()` 方法将被重写,以提供清晰且功能分离的装载选项: + +1. **“装载至货仓” (WULA.LoadIntoCargo)**: + * **功能**: 模拟原版穿梭机的装载行为。玩家选择人员和物品后,殖民者会将它们搬运到穿梭机,并存放到穿梭机自身的 `this.TransporterComp.innerContainer` 中。 + * **实现**: 调用 `this.TransporterComp` 提供的标准装载对话框和逻辑。 + +2. **“装载并传送入内” (WULA.LoadAndTeleport)**: + * **功能**: 玩家选择人员和物品,殖民者将其搬运到穿梭机并存放到 `this.TransporterComp.innerContainer`。**一旦装载完成**(即 `this.TransporterComp.leftToLoad` 为空),系统将自动触发一个内部传送过程,将 `this.TransporterComp.innerContainer` 中的所有物品和人员取出,并直接放置到口袋地图的指定位置。 + * **实现**: + * 通过一个布尔标志 (`doTeleportAfterLoading`) 来标记当前装载操作是否需要进行内部传送。 + * 在 `Tick()` 方法中监控 `this.TransporterComp.leftToLoad` 的状态。当其变为空且 `doTeleportAfterLoading` 为 `true` 时,调用 `TeleportContentsToPocketDimension()` 方法。 + * `TeleportContentsToPocketDimension()` 方法将遍历 `this.TransporterComp.innerContainer` 中的所有物品和人员,使用 `Thing.DeSpawn()` 和 `GenPlace.TryPlaceThing()` 将它们移动到 `pocketMap` 的指定位置。 + * **可见性**: 只有当口袋空间 (`pocketMap`) 已经生成 (`PocketMapExists == true`) 时,此按钮才会在UI中显示。 + +## 3. 关键组件/类 (`WulaFallenEmpire` 命名空间) + +* **`Building_ArmedShuttleWithPocket.cs` (主类)**: + * 继承 `Building_ArmedShuttle`。 + * 私有字段 `pocketMap` (类型 `Map`)。 + * 布尔标志 `pocketMapGenerated`。 + * `MapGeneratorDef mapGenerator` 和 `ThingDef exitDef` 用于XML配置。 + * `public Building_PocketMapExit exit` 引用口袋出口。 + * 布尔标志 `doTeleportAfterLoading` 和 `wasLoading` 用于控制传送逻辑。 + * 属性 `PocketMap`, `PocketMapExists`, `PocketMapGenerated`。 + * 重写 `ExposeData()` 进行持久化。 + * 重写 `DeSpawn()` 清理口袋地图。 + * 重写 `Tick()` 监控装载状态并触发传送。 + * 重写 `GetInspectString()` 提供状态信息。 + * 重写 `GetGizmos()` 提供自定义Gizmo。 + * 方法 `CreateLoadGizmo(bool teleport)` 生成装载按钮。 + * 方法 `TeleportContentsToPocketDimension()` 执行内部传送。 + * 方法 `EnterPocketSpace(IEnumerable pawns)` 将人员传送到口袋空间。 + * 方法 `SwitchToPocketSpace()` 切换视角。 + * 方法 `CreatePocketMap()` 生成口袋地图。 + * 方法 `GeneratePocketMapInt()` (受保护虚方法,可重写)。 + * 方法 `GetExtraGenSteps()` (受保护虚方法,可重写)。 + * 方法 `PlaceExitInPocketMap()` 在口袋地图中放置出口。 + * 方法 `TransferPawnToPocketSpace(Pawn pawn)` 将单个小人传送到口袋空间。 + * 方法 `TransferAllFromPocketToMainMap()` 在销毁时将口袋内容传回主地图。 + * 实现 `IThingHolder` 接口:`GetChildHolders()` (将 `this.TransporterComp` 添加为子容器) 和 `GetDirectlyHeldThings()` (返回一个空的 `ThingOwner` 实例)。 + * `UpdateExitPointTarget()` 更新出口目标位置。 + * 重写 `SpawnSetup()` 初始化组件和属性。 + +* **`Building_PocketMapExit.cs` (现有)**: + * 作为口袋空间的出口,负责将内部人员和物品传回主地图。 + +* **`PocketMapProperties.cs` (现有)**: + * `DefModExtension` 类,用于在XML中配置口袋地图的尺寸 (`pocketMapSize`)、地图生成器 (`mapGenerator`) 和出口建筑定义 (`exitDef`)。 + +## 4. XML 定义 (`1.6/1.6/Defs/ThingDefs_Buildings/Building_WULA_ArmedShuttleWithPocket.xml`) + +* `ThingDef` 定义 `WULA_ArmedShuttleWithPocket`。 +* `modExtensions` 中包含 `PocketMapProperties`: + ```xml + +
  • + WULA_PocketSpace_Small + WULA_PocketMapExit + (13, 13) +
  • +
    + ``` + +## 5. 预期结果 + +* 一个功能稳定、没有运行时崩溃的武装口袋穿梭机。 +* 清晰的UI和交互流程,允许玩家选择不同的装载模式。 +* 口袋空间能够正确生成、管理和销毁,内部物品和人员能够安全进出。 +* 代码结构更清晰,易于理解和未来的维护。 \ No newline at end of file diff --git a/Source/WulaFallenEmpire/3516260226.code-workspace b/Source/WulaFallenEmpire/3516260226.code-workspace index 28a1867a..3180f75b 100644 --- a/Source/WulaFallenEmpire/3516260226.code-workspace +++ b/Source/WulaFallenEmpire/3516260226.code-workspace @@ -3,6 +3,9 @@ { "name": "3516260226", "path": "../.." + }, + { + "path": "../../../../Data" } ], "settings": {} diff --git a/Source/WulaFallenEmpire/ThingDefOf_WULA.cs b/Source/WulaFallenEmpire/ThingDefOf_WULA.cs index ac9f6c1c..87611687 100644 --- a/Source/WulaFallenEmpire/ThingDefOf_WULA.cs +++ b/Source/WulaFallenEmpire/ThingDefOf_WULA.cs @@ -8,6 +8,7 @@ namespace WulaFallenEmpire { public static ThingDef WULA_MaintenancePod; public static ThingDef WULA_Charging_Station_Synth; + public static ThingDef WULA_PocketMapExit; static ThingDefOf_WULA() { diff --git a/Source/WulaFallenEmpire/WULA_Shuttle/Building_ArmedShuttleWithPocket.cs b/Source/WulaFallenEmpire/WULA_Shuttle/Building_ArmedShuttleWithPocket.cs index 4ee76348..44023df6 100644 --- a/Source/WulaFallenEmpire/WULA_Shuttle/Building_ArmedShuttleWithPocket.cs +++ b/Source/WulaFallenEmpire/WULA_Shuttle/Building_ArmedShuttleWithPocket.cs @@ -11,105 +11,191 @@ using Verse.Sound; namespace WulaFallenEmpire { + /// + /// 内置空间武装穿梭机 - 基于原版MapPortal机制的口袋空间实现 + /// 结合了武装防御能力和口袋空间技术的复合型载具 + /// [StaticConstructorOnStartup] public class Building_ArmedShuttleWithPocket : Building_ArmedShuttle, IThingHolder { - #region 静态图标定义 + #region 静态图标定义(使用原版MapPortal的图标) + /// 查看口袋地图图标 private static readonly Texture2D ViewPocketMapTex = ContentFinder.Get("UI/Commands/ViewCave"); - private static readonly Texture2D EnterPocketMapTex = ContentFinder.Get("UI/Commands/EnterCave"); - private static readonly Texture2D TeleportAndLoadTex = ContentFinder.Get("UI/Commands/LoadTransporter"); - + + /// 取消进入图标 + private static readonly Texture2D CancelEnterTex = ContentFinder.Get("UI/Designators/Cancel"); + + /// 默认进入图标 + private static readonly Texture2D DefaultEnterTex = ContentFinder.Get("UI/Commands/EnterCave"); + #endregion - #region 口袋空间字段 + /// 内部口袋地图实例 private Map pocketMap; + + /// 口袋地图是否已生成 private bool pocketMapGenerated; + + /// 内部空间大小 private IntVec2 pocketMapSize = new IntVec2(80, 80); + + /// 地图生成器定义 private MapGeneratorDef mapGenerator; + + /// 退出点定义 private ThingDef exitDef; + + /// 允许直接访问(无需骇入) + private bool allowDirectAccess = true; + + /// 口袋空间内的物品容器 + private ThingOwner innerContainer; + + /// 口袋地图退出点(模仿原版 MapPortal.exit) public Building_PocketMapExit exit; - private bool doTeleportAfterLoading = false; - private bool wasLoading = false; - + /// 是否已经进入过(模仿原版 MapPortal.beenEntered) + protected bool beenEntered; + + /// 待加载物品列表(模仿原版 MapPortal.leftToLoad) + public List leftToLoad; + + /// 是否已通知无法加载更多(模仿原版 MapPortal.notifiedCantLoadMore) + public bool notifiedCantLoadMore; + #endregion #region 属性 - // We use the public properties from the base class: this.ShuttleComp and this.TransporterComp + /// 获取内部口袋地图 public Map PocketMap => pocketMap; - public bool PocketMapExists + + /// 口袋地图是否已生成 + public bool PocketMapGenerated => pocketMapGenerated; + + /// 是否允许直接访问口袋空间 + public bool AllowDirectAccess => allowDirectAccess; + + /// 内部容器 + public ThingOwner InnerContainer => innerContainer; + + /// + /// 获取进入按钮的图标 + /// + protected virtual Texture2D EnterTex => DefaultEnterTex; + + /// + /// 获取进入按钮的文本 + /// + public virtual string EnterString => "WULA.PocketSpace.Enter".Translate(); + + /// + /// 获取取消进入按钮的文本 + /// + public virtual string CancelEnterString => "WULA.PocketSpace.CancelEnter".Translate(); + + /// + /// 获取进入中的文本 + /// + public virtual string EnteringString => "WULA.PocketSpace.Entering".Translate(); + + /// 加载是否正在进行(模仿原版 MapPortal.LoadInProgress) + public bool LoadInProgress { get { - if (pocketMap != null && pocketMap.Parent?.HasMap == false) + if (leftToLoad != null) { - pocketMap = null; + return leftToLoad.Any(); } - return pocketMap != null; + return false; } } - public bool PocketMapGenerated => pocketMapGenerated; + + /// 是否有Pawn可以加载任何东西(模仿原版 MapPortal.AnyPawnCanLoadAnythingNow) + public bool AnyPawnCanLoadAnythingNow + { + get + { + if (!LoadInProgress) + { + return false; + } + if (!Spawned) + { + return false; + } + // 简化版本,只检查基本条件 + return Map.mapPawns.AllPawnsSpawned.Any(p => p.IsColonist && p.CanReach(this, PathEndMode.Touch, Danger.Deadly)); + } + } + + #endregion + + #region 构造函数 + + public Building_ArmedShuttleWithPocket() + { + innerContainer = new ThingOwner(this, oneStackOnly: false); + } #endregion #region 基础重写方法 - + + + + public override void PostMake() + { + base.PostMake(); + if (innerContainer == null) + { + innerContainer = new ThingOwner(this, oneStackOnly: false); + } + } + public override void ExposeData() { base.ExposeData(); - - if (Scribe.mode == LoadSaveMode.Saving && pocketMap != null && pocketMap.Parent?.HasMap == false) - { - pocketMap = null; - } - Scribe_Deep.Look(ref pocketMap, "pocketMap"); Scribe_Values.Look(ref pocketMapGenerated, "pocketMapGenerated", false); Scribe_Values.Look(ref pocketMapSize, "pocketMapSize", new IntVec2(80, 80)); Scribe_Defs.Look(ref mapGenerator, "mapGenerator"); Scribe_Defs.Look(ref exitDef, "exitDef"); - Scribe_References.Look(ref exit, "exit"); + Scribe_Values.Look(ref allowDirectAccess, "allowDirectAccess", true); + Scribe_Deep.Look(ref innerContainer, "innerContainer", this); + + if (Scribe.mode == LoadSaveMode.PostLoadInit) + { + if (innerContainer == null) + { + innerContainer = new ThingOwner(this, oneStackOnly: false); + } + } } public override void DeSpawn(DestroyMode mode = DestroyMode.Vanish) { + // 清理口袋地图 if (pocketMap != null && pocketMapGenerated) { try { + // 将口袋空间中的物品和人员转移到主地图 TransferAllFromPocketToMainMap(); + + // 销毁口袋地图 PocketMapUtility.DestroyPocketMap(pocketMap); } catch (Exception ex) { - Log.Error($"[WULA] Error cleaning up pocket map on DeSpawn: {ex}"); + Log.Error($"[WULA] Error cleaning up pocket map: {ex}"); } } base.DeSpawn(mode); } - - protected override void Tick() - { - base.Tick(); - - if (!Spawned) return; - - bool isLoading = this.TransporterComp.leftToLoad != null && this.TransporterComp.leftToLoad.Any(x => x.CountToTransfer > 0); - if (wasLoading && !isLoading && doTeleportAfterLoading) - { - TeleportContentsToPocketDimension(); - doTeleportAfterLoading = false; - } - wasLoading = isLoading; - - if (this.IsHashIntervalTick(2500) && pocketMapGenerated && exit != null) - { - UpdateExitPointTarget(); - } - } public override string GetInspectString() { @@ -118,10 +204,19 @@ namespace WulaFallenEmpire if (pocketMapGenerated) { sb.AppendLine("WULA.PocketSpace.Status".Translate() + ": " + "WULA.PocketSpace.Ready".Translate()); - if (pocketMap.mapPawns.AllPawnsSpawned.Any(p => p.IsColonist)) + if (innerContainer.Count > 0) { - int pawnCount = pocketMap.mapPawns.AllPawnsSpawned.Count(p => p.IsColonist); - sb.AppendLine("WULA.PocketSpace.PawnCount".Translate(pawnCount)); + sb.AppendLine("WULA.PocketSpace.ItemCount".Translate(innerContainer.Count)); + } + + // 显示口袋空间中的人员数量 + if (pocketMap != null) + { + int pawnCount = pocketMap.mapPawns.AllPawnsSpawned.Where(p => p.IsColonist).Count(); + if (pawnCount > 0) + { + sb.AppendLine("WULA.PocketSpace.PawnCount".Translate(pawnCount)); + } } } else @@ -134,150 +229,101 @@ namespace WulaFallenEmpire #endregion - #region Gizmos - - public override IEnumerable GetGizmos() - { - foreach (var baseGizmo in base.GetGizmos()) - { - var command = baseGizmo as Command; - if (command != null && (command.defaultLabel == "CommandLoadTransporter".Translate() || command.defaultLabel == "CommandLoadTransporter".Translate() + "...")) - { - yield return CreateLoadGizmo(false); - if (PocketMapExists) // Only show teleport load if pocket map exists - { - yield return CreateLoadGizmo(true); - } - } - else - { - yield return baseGizmo; - } - } - - if (pocketMapGenerated && PocketMapExists) - { - yield return new Command_Action - { - defaultLabel = "WULA.ViewPocketSpace".Translate(), - defaultDesc = "WULA.ViewPocketSpaceDesc".Translate(), - icon = ViewPocketMapTex, - action = SwitchToPocketSpace - }; - } - else - { - yield return new Command_Action - { - defaultLabel = "WULA.CreatePocketSpace".Translate(), - defaultDesc = "WULA.CreatePocketSpaceDesc".Translate(), - icon = EnterPocketMapTex, - action = CreatePocketMap - }; - } - } - - private Command_Action CreateLoadGizmo(bool teleport) - { - var command = new Command_Action(); - var originalLoadGizmo = this.TransporterComp.CompGetGizmosExtra().FirstOrDefault(g => g is Command && (((Command)g).defaultLabel == "CommandLoadTransporter".Translate() || ((Command)g).defaultLabel == "CommandLoadTransporter".Translate() + "...")) as Command; - - if (teleport) - { - command.defaultLabel = "WULA.LoadAndTeleport".Translate(); - command.defaultDesc = "WULA.LoadAndTeleportDesc".Translate(); - command.icon = TeleportAndLoadTex; - } - else - { - command.defaultLabel = "WULA.LoadIntoCargo".Translate(); - command.defaultDesc = "WULA.LoadIntoCargoDesc".Translate(); - command.icon = originalLoadGizmo?.icon ?? ContentFinder.Get("UI/Commands/LoadTransporter"); - } - - if (originalLoadGizmo != null) - { - command.action = () => - { - doTeleportAfterLoading = teleport; - originalLoadGizmo.ProcessInput(null); - }; - - if (originalLoadGizmo.Disabled) - { - command.Disable(originalLoadGizmo.disabledReason); - } - } - else - { - command.Disable("Error: Could not find original load command.".Translate()); - } - - // This disabling logic is now redundant if we control visibility in GetGizmos, - // but keeping it here for safety against direct calls. - if (teleport && !PocketMapExists) - { - command.Disable("WULA.PocketSpace.NotGenerated".Translate()); - } - - return command; - } - - #endregion - #region 口袋空间核心方法 - - public void TeleportContentsToPocketDimension() + + /// + /// 检查是否可以进入口袋空间 + /// + public bool CanEnterPocketSpace() { - if (!PocketMapExists || this.TransporterComp == null) return; - - var thingsToTeleport = this.TransporterComp.innerContainer.ToList(); - if (!thingsToTeleport.Any()) return; + if (!allowDirectAccess) + { + return false; // 需要特殊权限 + } - Log.Message($"[WULA] Teleporting {thingsToTeleport.Count} things to pocket dimension."); - - IntVec3 spawnCenter = exit?.Position ?? pocketMap.Center; + if (!Spawned) + { + return false; + } - this.TransporterComp.innerContainer.TryDropAll(spawnCenter, pocketMap, ThingPlaceMode.Near); - - Messages.Message("WULA.TeleportComplete".Translate(thingsToTeleport.Count), this, MessageTypeDefOf.PositiveEvent); + return true; } - public void EnterPocketSpace(IEnumerable pawns) + /// + /// 进入口袋空间 - 基于原版PocketMapUtility实现 + /// + public void EnterPocketSpace(IEnumerable pawns = null) { - if (!PocketMapExists) - { - Messages.Message("WULA.PocketSpace.NotGenerated".Translate(), this, MessageTypeDefOf.RejectInput); - return; - } - - if (pawns == null || !pawns.Any()) + if (!CanEnterPocketSpace()) { + Messages.Message("WULA.PocketSpace.CannotEnter".Translate(), this, MessageTypeDefOf.RejectInput); return; } - foreach (Pawn pawn in pawns.ToList()) + // 创建或获取口袋地图 + if (pocketMap == null && !pocketMapGenerated) { - if (pawn != null && pawn.Spawned) + CreatePocketMap(); + } + + if (pocketMap == null) + { + Messages.Message("WULA.PocketSpace.CreationFailed".Translate(), this, MessageTypeDefOf.RejectInput); + return; + } + + // 传送玩家到口袋空间 + List pawnsToTransfer = new List(); + + if (pawns != null) + { + pawnsToTransfer.AddRange(pawns.Where(p => p != null && p.Spawned && p.IsColonist)); + } + else + { + // 如果没有指定人员,传送选中的殖民者 + pawnsToTransfer.AddRange(Find.Selector.SelectedPawns.Where(p => p.IsColonist)); + } + + if (pawnsToTransfer.Count == 0) + { + Messages.Message("WULA.PocketSpace.NoPawnsSelected".Translate(), this, MessageTypeDefOf.RejectInput); + return; + } + + // 执行传送 + int transferredCount = 0; + foreach (Pawn pawn in pawnsToTransfer) + { + if (TransferPawnToPocketSpace(pawn)) { - TransferPawnToPocketSpace(pawn); + transferredCount++; } } - - Messages.Message("WULA.PocketSpace.TransferSuccess".Translate(pawns.Count()), MessageTypeDefOf.PositiveEvent); - Current.Game.CurrentMap = pocketMap; + + if (transferredCount > 0) + { + Messages.Message("WULA.PocketSpace.TransferSuccess".Translate(transferredCount), MessageTypeDefOf.PositiveEvent); + + // 切换到口袋地图 + Current.Game.CurrentMap = pocketMap; + Find.CameraDriver.JumpToCurrentMapLoc(pocketMap.Center); + } } - + + /// + /// 切换到口袋空间视角 + /// public void SwitchToPocketSpace() { - if (!PocketMapExists) + if (pocketMap == null) { if (!pocketMapGenerated) { CreatePocketMap(); } - if (!PocketMapExists) + if (pocketMap == null) { Messages.Message("WULA.PocketSpace.CreationFailed".Translate(), this, MessageTypeDefOf.RejectInput); return; @@ -288,73 +334,87 @@ namespace WulaFallenEmpire Find.CameraDriver.JumpToCurrentMapLoc(pocketMap.Center); } + /// + /// 创建口袋地图 - 使用原版PocketMapUtility(模仿 MapPortal.GeneratePocketMap) + /// private void CreatePocketMap() { try { - PocketMapUtility.currentlyGeneratingPortal = null; + // 模仿原版 MapPortal.GeneratePocketMap 的实现 + PocketMapUtility.currentlyGeneratingPortal = null; // 我们不是 MapPortal,但可以设为 null pocketMap = GeneratePocketMapInt(); PocketMapUtility.currentlyGeneratingPortal = null; if (pocketMap != null) { pocketMapGenerated = true; - PlaceExitInPocketMap(); - Log.Message($"[WULA] Pocket map created successfully with size {pocketMap.Size}"); - Messages.Message("WULA.PocketSpace.CreationSuccess".Translate(), this, MessageTypeDefOf.PositiveEvent); + + // 在口袋地图中心放置退出点 + CreateExitPoint(); + + Log.Message($"[WULA] Successfully created pocket map of size {pocketMapSize} for armed shuttle"); } else { Log.Error("[WULA] Failed to create pocket map"); - Messages.Message("WULA.PocketSpace.CreationFailed".Translate(), this, MessageTypeDefOf.RejectInput); } } catch (Exception ex) { - Log.Error($"[WULA] Error creating pocket map: {ex}"); - PocketMapUtility.currentlyGeneratingPortal = null; + Log.Error($"[WULA] Exception creating pocket map: {ex}"); } } - - protected virtual Map GeneratePocketMapInt() - { - if (mapGenerator == null) - { - mapGenerator = DefDatabase.GetNamed("WULA_PocketSpace_Small", false) - ?? DefDatabase.GetNamed("AncientStockpile", false) - ?? MapGeneratorDefOf.Base_Player; - } - - IntVec3 mapSize = new IntVec3(pocketMapSize.x, 1, pocketMapSize.z); - return PocketMapUtility.GeneratePocketMap(mapSize, mapGenerator, GetExtraGenSteps(), this.Map); - } + /// + /// 生成口袋地图的内部实现(模仿 MapPortal.GeneratePocketMapInt) + /// + protected virtual Map GeneratePocketMapInt() + { + return PocketMapUtility.GeneratePocketMap(new IntVec3(pocketMapSize.x, 1, pocketMapSize.z), mapGenerator, GetExtraGenSteps(), this.Map); + } + + /// + /// 获取额外的生成步骤(模仿 MapPortal.GetExtraGenSteps) + /// protected virtual IEnumerable GetExtraGenSteps() { - return Enumerable.Empty(); + return System.Linq.Enumerable.Empty(); } - private void PlaceExitInPocketMap() + /// + /// 在口袋地图中创建退出点(模仿原版) + /// + private void CreateExitPoint() { if (pocketMap == null || exitDef == null) return; try { - IntVec3 exitPos = CellFinder.RandomClosewalkCellNear(pocketMap.Center, pocketMap, 5, + // 在地图中心找一个合适的位置 + IntVec3 exitPos = pocketMap.Center; + + // 寻找可建造的位置 + if (!exitPos.Standable(pocketMap) || exitPos.GetThingList(pocketMap).Any(t => t.def.category == ThingCategory.Building)) + { + exitPos = CellFinder.RandomClosewalkCellNear(pocketMap.Center, pocketMap, 5, p => p.Standable(pocketMap) && !p.GetThingList(pocketMap).Any(t => t.def.category == ThingCategory.Building)); + } if (exitPos.IsValid) { + // 创建退出点建筑 Thing exitBuilding = ThingMaker.MakeThing(exitDef); if (exitBuilding is Building_PocketMapExit exitPortal) { exitPortal.targetMap = this.Map; exitPortal.targetPos = this.Position; exitPortal.parentShuttle = this; - exit = exitPortal; + exit = exitPortal; // 设置 exit 引用,模仿原版 MapPortal } GenPlace.TryPlaceThing(exitBuilding, exitPos, pocketMap, ThingPlaceMode.Direct); + Log.Message($"[WULA] Created exit point at {exitPos} in pocket map"); } else { @@ -367,12 +427,16 @@ namespace WulaFallenEmpire } } + /// + /// 将单个Pawn传送到口袋空间 + /// private bool TransferPawnToPocketSpace(Pawn pawn) { if (pawn == null || !pawn.Spawned || pocketMap == null) return false; try { + // 找一个安全的位置 IntVec3 spawnPos = CellFinder.RandomClosewalkCellNear(pocketMap.Center, pocketMap, 10, p => p.Standable(pocketMap) && !p.GetThingList(pocketMap).Any(t => t is Pawn)); @@ -391,29 +455,53 @@ namespace WulaFallenEmpire return false; } + /// + /// 将所有物品和人员从口袋空间转移到主地图 + /// private void TransferAllFromPocketToMainMap() { if (pocketMap == null || !Spawned) return; try { - List thingsToTransfer = new List(pocketMap.listerThings.AllThings); - foreach (Thing thing in thingsToTransfer) + // 转移所有殖民者 + List pawnsToTransfer = pocketMap.mapPawns.AllPawnsSpawned + .Where(p => p.IsColonist).ToList(); + + foreach (Pawn pawn in pawnsToTransfer) { - if (thing.def.category != ThingCategory.Mote && thing.def.category != ThingCategory.Filth) + IntVec3 spawnPos = CellFinder.RandomClosewalkCellNear(this.Position, this.Map, 5, + p => p.Standable(this.Map) && !p.GetThingList(this.Map).Any(t => t is Pawn)); + + if (spawnPos.IsValid) { - if(this.TransporterComp.innerContainer.TryAddOrTransfer(thing)) - { - //Success - } - else - { - thing.Destroy(); - } + pawn.DeSpawn(); + GenPlace.TryPlaceThing(pawn, spawnPos, this.Map, ThingPlaceMode.Near); + } + } + + // 转移所有物品到内部容器 + List itemsToTransfer = pocketMap.listerThings.AllThings + .Where(t => t.def.category == ThingCategory.Item && t.def.EverHaulable).ToList(); + + foreach (Thing item in itemsToTransfer) + { + if (item.Spawned) + { + item.DeSpawn(); + if (!innerContainer.TryAdd(item)) + { + // 如果容器满了,丢到穿梭机附近 + IntVec3 dropPos = CellFinder.RandomClosewalkCellNear(this.Position, this.Map, 3); + if (dropPos.IsValid) + { + GenPlace.TryPlaceThing(item, dropPos, this.Map, ThingPlaceMode.Near); + } + } } } - Log.Message($"[WULA] Transferred {thingsToTransfer.Count} things from pocket space to shuttle cargo."); + Log.Message($"[WULA] Transferred {pawnsToTransfer.Count} pawns and {itemsToTransfer.Count} items from pocket space"); } catch (Exception ex) { @@ -422,64 +510,436 @@ namespace WulaFallenEmpire } #endregion - - #region IThingHolder - public void GetChildHolders(List outChildren) + #region Gizmo方法 + + public override IEnumerable GetGizmos() { - if (this.TransporterComp != null) + foreach (Gizmo gizmo in base.GetGizmos()) { - outChildren.Add(this.TransporterComp); + yield return gizmo; + } + + if (allowDirectAccess) + { + // 进入口袋空间按钮(模仿原版MapPortal) + Command_Action enterCommand = new Command_Action(); + enterCommand.action = delegate + { + // 使用自定义的殖民者选择对话框,模仿原版Dialog_EnterPortal的行为 + OpenPawnSelectionDialog(); + }; + enterCommand.icon = EnterTex; + enterCommand.defaultLabel = EnterString + "..."; + enterCommand.defaultDesc = "WULA.PocketSpace.EnterDesc".Translate(); + + // 检查是否可以进入(模仿原版MapPortal.IsEnterable) + string reason; + enterCommand.Disabled = !IsEnterable(out reason); + enterCommand.disabledReason = reason; + yield return enterCommand; + + // 查看口袋地图按钮(模仿原版MapPortal) + if (pocketMap != null) + { + yield return new Command_Action + { + defaultLabel = "WULA.PocketSpace.ViewMap".Translate(), + defaultDesc = "WULA.PocketSpace.ViewMapDesc".Translate(), + icon = ViewPocketMapTex, + action = delegate + { + // 模仿原版,跳转到口袋地图并选中退出点 + if (exit != null) + { + CameraJumper.TryJumpAndSelect(exit); + } + else + { + SwitchToPocketSpace(); + } + } + }; + } } } + + + #endregion + + #region IThingHolder接口实现 + public ThingOwner GetDirectlyHeldThings() { - return null; + return innerContainer; // 使用我们自己的容器而不是 PortalContainerProxy + } + + public void GetChildHolders(List outChildren) + { + ThingOwnerUtility.AppendThingHoldersFromThings(outChildren, GetDirectlyHeldThings()); } #endregion - - #region 穿梭机移动更新 - public void UpdateExitPointTarget() + #region MapPortal兼容接口(使Dialog_EnterPortal能正常工作) + + /// + /// 检查是否可以进入(模仿原版MapPortal.IsEnterable) + /// + public virtual bool IsEnterable(out string reason) { - if (exit != null && exit.Spawned && exit.targetPos != this.Position) + if (!allowDirectAccess) { - exit.targetPos = this.Position; + reason = "WULA.PocketSpace.AccessDenied".Translate(); + return false; + } + + if (!Spawned) + { + reason = "WULA.PocketSpace.NotSpawned".Translate(); + return false; + } + + reason = ""; + return true; + } + + /// + /// 获取目标地图(模仿原版MapPortal.GetOtherMap) + /// + public virtual Map GetOtherMap() + { + if (pocketMap == null) + { + CreatePocketMap(); + } + return pocketMap; + } + + /// + /// 获取目标位置(模仿原版MapPortal.GetDestinationLocation) + /// + public virtual IntVec3 GetDestinationLocation() + { + if (exit != null) + { + return exit.Position; + } + return pocketMap?.Center ?? IntVec3.Invalid; + } + + /// + /// 处理进入事件(模仿原版MapPortal.OnEntered) + /// + public virtual void OnEntered(Pawn pawn) + { + // 通知物品被添加(用于统计和管理) + Notify_ThingAdded(pawn); + + // 播放传送音效(如果存在) + if (Find.CurrentMap == this.Map) + { + // 可以在这里添加音效播放 + // def.portal?.traverseSound?.PlayOneShot(this); } } - #endregion - - #region 启动与生成 - - public override void SpawnSetup(Map map, bool respawningAfterLoad) + /// + /// 打开殖民者选择对话框(模仿原版Dialog_EnterPortal的功能) + /// + private void OpenPawnSelectionDialog() { - base.SpawnSetup(map, respawningAfterLoad); + // 获取所有可用的殖民者 + List availablePawns = Map.mapPawns.AllPawnsSpawned + .Where(p => p.IsColonist && !p.Downed && p.CanReach(this, PathEndMode.Touch, Danger.Deadly)) + .ToList(); - var props = def.GetModExtension(); - if (props != null) + if (availablePawns.Count == 0) { - pocketMapSize = props.pocketMapSize; - mapGenerator = props.mapGenerator; - exitDef = props.exitDef; + Messages.Message("WULA.PocketSpace.NoPawnsAvailable".Translate(), this, MessageTypeDefOf.RejectInput); + return; + } + + // 创建选项列表 + List options = new List(); + + // 添加单个殖民者选项 + foreach (Pawn pawn in availablePawns) + { + FloatMenuOption option = new FloatMenuOption( + $"{pawn.LabelShort}", + delegate + { + EnterPocketSpace(new List { pawn }); + } + ); + options.Add(option); + } + + // 添加“全部殖民者”选项 + if (availablePawns.Count > 1) + { + FloatMenuOption allOption = new FloatMenuOption( + "WULA.PocketSpace.AllColonists".Translate(availablePawns.Count), + delegate + { + EnterPocketSpace(availablePawns); + } + ); + options.Add(allOption); + } + + // 添加“只切换视角”选项 + FloatMenuOption viewOnlyOption = new FloatMenuOption( + "WULA.PocketSpace.ViewOnly".Translate(), + delegate + { + if (pocketMapGenerated) + { + SwitchToPocketSpace(); + } + else + { + CreatePocketMap(); + if (pocketMapGenerated) + { + SwitchToPocketSpace(); + } + } + } + ); + options.Add(viewOnlyOption); + + // 显示浮动菜单 + FloatMenu floatMenu = new FloatMenu(options); + Find.WindowStack.Add(floatMenu); + } + + #endregion + + #region 原版MapPortal的物品传送方法 + + /// + /// 通知有物品被添加(模仿原版 MapPortal.Notify_ThingAdded) + /// + public void Notify_ThingAdded(Thing t) + { + SubtractFromToLoadList(t, t.stackCount); + } + + /// + /// 添加到加载列表(模仿原版 MapPortal.AddToTheToLoadList) + /// + public void AddToTheToLoadList(TransferableOneWay t, int count) + { + if (!t.HasAnyThing || count <= 0) + { + return; + } + if (leftToLoad == null) + { + leftToLoad = new List(); + } + TransferableOneWay transferableOneWay = TransferableUtility.TransferableMatching(t.AnyThing, leftToLoad, TransferAsOneMode.PodsOrCaravanPacking); + if (transferableOneWay != null) + { + for (int i = 0; i < t.things.Count; i++) + { + if (!transferableOneWay.things.Contains(t.things[i])) + { + transferableOneWay.things.Add(t.things[i]); + } + } + if (transferableOneWay.CanAdjustBy(count).Accepted) + { + transferableOneWay.AdjustBy(count); + } } else { - pocketMapSize = new IntVec2(50, 50); - mapGenerator = MapGeneratorDefOf.Base_Player; - exitDef = ThingDef.Named("WULA_PocketMapExit"); + TransferableOneWay transferableOneWay2 = new TransferableOneWay(); + leftToLoad.Add(transferableOneWay2); + transferableOneWay2.things.AddRange(t.things); + transferableOneWay2.AdjustTo(count); + } + } + + /// + /// 从加载列表中减去(模仿原版 MapPortal.SubtractFromToLoadList) + /// + public int SubtractFromToLoadList(Thing t, int count) + { + if (leftToLoad == null) + { + return 0; + } + TransferableOneWay transferableOneWay = TransferableUtility.TransferableMatchingDesperate(t, leftToLoad, TransferAsOneMode.PodsOrCaravanPacking); + if (transferableOneWay == null) + { + return 0; + } + if (transferableOneWay.CountToTransfer <= 0) + { + return 0; + } + int num = Mathf.Min(count, transferableOneWay.CountToTransfer); + transferableOneWay.AdjustBy(-num); + transferableOneWay.things.Remove(t); + if (transferableOneWay.CountToTransfer <= 0) + { + leftToLoad.Remove(transferableOneWay); + } + return num; + } + + /// + /// 取消加载(模仿原版 MapPortal.CancelLoad) + /// + public void CancelLoad() + { + // 简化版本,只清理列表 + if (leftToLoad != null) + { + leftToLoad.Clear(); + } + } + + #endregion + + #region 穿梭机状态变化处理 + + /// + /// 更新口袋空间中退出点的目标位置(处理穿梭机位置变化) + /// + public void UpdateExitPointTarget() + { + if (pocketMap == null || exit == null) return; + + try + { + // 如果退出点是我们的Building_PocketMapExit类型,更新其目标位置 + if (exit is Building_PocketMapExit pocketExit) + { + // 更新目标地图和位置 + if (this.Spawned) + { + // 穿梭机在地图上,更新目标位置 + if (pocketExit.targetMap != this.Map || pocketExit.targetPos != this.Position) + { + pocketExit.targetMap = this.Map; + pocketExit.targetPos = this.Position; + pocketExit.parentShuttle = this; + Log.Message($"[WULA] Updated pocket map exit target to shuttle location: {this.Map?.uniqueID} at {this.Position}"); + } + } + else + { + // 穿梭机不在地图上(可能在飞行中),记录警告但保持原有目标 + Log.Warning($"[WULA] Shuttle not spawned, pocket map exit target may be outdated. Current target: {pocketExit.targetMap?.uniqueID} at {pocketExit.targetPos}"); + } + } + } + catch (Exception ex) + { + Log.Error($"[WULA] Error updating exit point target: {ex}"); + } + } + + /// + /// 重写Tick方法,定期检查穿梭机状态变化 + /// + protected override void Tick() + { + base.Tick(); + + // 每隔一段时间检查退出点目标是否需要更新(处理穿梭机移动的情况) + if (this.IsHashIntervalTick(2500) && pocketMapGenerated && exit != null) + { + UpdateExitPointTarget(); + } + } + + /// + /// 重写 SpawnSetup,确保位置变化时更新退出点 + /// + public override void SpawnSetup(Map map, bool respawningAfterLoad) + { + // 保存旧位置信息 + Map oldMap = this.Map; + IntVec3 oldPos = this.Position; + + base.SpawnSetup(map, respawningAfterLoad); + + if (innerContainer == null) + { + innerContainer = new ThingOwner(this, oneStackOnly: false); + } + + // 简化实现,直接使用 innerContainer 而不是 PortalContainerProxy + // 因为 PortalContainerProxy 需要 MapPortal 类型,但我们不是继承自 MapPortal + + // 更新退出点目标(处理穿梭机重新部署的情况) + UpdateExitPointTarget(); + + // 从 ThingDef 中读取 portal 配置 + if (def.HasModExtension()) + { + var portalProps = def.GetModExtension(); + if (portalProps.pocketMapGenerator != null) + { + mapGenerator = portalProps.pocketMapGenerator; + } + if (portalProps.exitDef != null) + { + exitDef = portalProps.exitDef; + } + if (portalProps.pocketMapSize != IntVec2.Zero) + { + pocketMapSize = portalProps.pocketMapSize; + } + allowDirectAccess = portalProps.allowDirectAccess; + } + + // 初始化地图生成器和退出点定义(如果 XML 中没有配置) + if (mapGenerator == null) + { + mapGenerator = DefDatabase.GetNamed("AncientStockpile", false) + ?? DefDatabase.GetNamed("Base_Player", false) + ?? MapGeneratorDefOf.Base_Player; + } + + if (exitDef == null) + { + exitDef = DefDatabase.GetNamed("WULA_PocketMapExit", false) + ?? ThingDefOf.Door; + } + + // 如果位置发生了变化,记录日志 + if (oldMap != null && (oldMap != map || oldPos != this.Position)) + { + Log.Message($"[WULA] Shuttle moved from {oldMap?.uniqueID}:{oldPos} to {map?.uniqueID}:{this.Position}, updating pocket map exit target"); } } #endregion } + /// + /// 口袋空间属性配置类 + /// public class PocketMapProperties : DefModExtension { - public IntVec2 pocketMapSize = new IntVec2(50, 50); - public MapGeneratorDef mapGenerator; + /// 口袋地图生成器 + public MapGeneratorDef pocketMapGenerator; + + /// 退出点定义 public ThingDef exitDef; + + /// 口袋地图大小 + public IntVec2 pocketMapSize = new IntVec2(13, 13); + + /// 允许直接访问 + public bool allowDirectAccess = true; } } \ No newline at end of file diff --git a/Source/WulaFallenEmpire/WULA_Shuttle/Building_PocketMapExit.cs b/Source/WulaFallenEmpire/WULA_Shuttle/Building_PocketMapExit.cs index 0a8235fd..d7113ba0 100644 --- a/Source/WulaFallenEmpire/WULA_Shuttle/Building_PocketMapExit.cs +++ b/Source/WulaFallenEmpire/WULA_Shuttle/Building_PocketMapExit.cs @@ -112,6 +112,106 @@ namespace WulaFallenEmpire /// protected override Texture2D EnterTex => ContentFinder.Get("UI/Commands/ViewCave"); + /// + /// 重写GetGizmos方法,添加穿梭机装载相关按钮 + /// + public override IEnumerable GetGizmos() + { + // 获取基类的按钮(退出空间和查看地图按钮) + foreach (Gizmo gizmo in base.GetGizmos()) + { + yield return gizmo; + } + + // 如果有父穿梭机,添加穿梭机相关的装载按钮 + if (parentShuttle != null) + { + // 查看主地图按钮 + yield return new Command_Action + { + defaultLabel = "WULA.PocketSpace.ViewMainMap".Translate(), + defaultDesc = "WULA.PocketSpace.ViewMainMapDesc".Translate(), + icon = ContentFinder.Get("UI/Commands/ViewWorld"), + action = delegate + { + if (targetMap != null) + { + Current.Game.CurrentMap = targetMap; + if (parentShuttle != null && parentShuttle.Spawned) + { + Find.CameraDriver.JumpToCurrentMapLoc(parentShuttle.Position); + Find.Selector.Select(parentShuttle); + } + else + { + Find.CameraDriver.JumpToCurrentMapLoc(targetPos); + } + } + } + }; + + // 穿梭机装载管理按钮 + if (parentShuttle.Spawned) + { + // 获取穿梭机的CompTransporter组件 + CompTransporter transporter = parentShuttle.GetComp(); + if (transporter != null) + { + // 添加装载按钮(模仿原版CompTransporter的功能) + yield return new Command_Action + { + defaultLabel = "WULA.PocketSpace.LoadShuttle".Translate(), + defaultDesc = "WULA.PocketSpace.LoadShuttleDesc".Translate(), + icon = ContentFinder.Get("UI/Commands/LoadTransporter"), + action = delegate + { + OpenShuttleLoadingDialog(transporter); + } + }; + + // 如果正在装载,添加取消装载按钮 + if (transporter.LoadingInProgress) + { + yield return new Command_Action + { + defaultLabel = "WULA.PocketSpace.CancelLoading".Translate(), + defaultDesc = "WULA.PocketSpace.CancelLoadingDesc".Translate(), + icon = ContentFinder.Get("UI/Designators/Cancel"), + action = delegate + { + transporter.CancelLoad(); + } + }; + } + } + + // 添加穿梭机发射按钮(如果正在装载且可以发射) + CompLaunchable launchable = parentShuttle.GetComp(); + if (launchable != null && transporter != null && !transporter.LoadingInProgress) + { + foreach (Gizmo gizmo in launchable.CompGetGizmosExtra()) + { + yield return gizmo; + } + } + } + + // 穿梭机状态信息按钮 + yield return new Command_Action + { + defaultLabel = "WULA.PocketSpace.ShuttleStatus".Translate(), + defaultDesc = "WULA.PocketSpace.ShuttleStatusDesc".Translate(), + icon = ContentFinder.Get("UI/Commands/InfoCard"), + action = delegate + { + ShowShuttleStatusInfo(); + } + }; + } + } + + + /// /// 单个人员退出口袋空间(简化版本,利用MapPortal功能) /// @@ -142,5 +242,78 @@ namespace WulaFallenEmpire Log.Error($"[WULA] Error exiting pocket space: {ex}"); } } + + /// + /// 打开穿梭机装载对话框 + /// + private void OpenShuttleLoadingDialog(CompTransporter transporter) + { + if (transporter == null) return; + + try + { + // 使用原版的Dialog_LoadTransporters打开装载对话框 + Find.WindowStack.Add(new Dialog_LoadTransporters(parentShuttle.Map, new List { transporter })); + } + catch (System.Exception ex) + { + Log.Error($"[WULA] Error opening shuttle loading dialog: {ex}"); + Messages.Message("WULA.PocketSpace.LoadingDialogError".Translate(), MessageTypeDefOf.RejectInput); + } + } + + /// + /// 显示穿梭机状态信息 + /// + private void ShowShuttleStatusInfo() + { + if (parentShuttle == null) return; + + StringBuilder statusText = new StringBuilder(); + + // 基本信息 + statusText.AppendLine("WULA.PocketSpace.ShuttleInfo".Translate()); + statusText.AppendLine($"• 状态: {(parentShuttle.Spawned ? "已部署" : "飞行中")}"); + + if (parentShuttle.Spawned) + { + statusText.AppendLine($"• 位置: {targetMap?.Parent?.Label ?? "未知"} ({targetPos.x}, {targetPos.z})"); + + // 燃料信息 + CompRefuelable fuel = parentShuttle.GetComp(); + if (fuel != null) + { + statusText.AppendLine($"• 燃料: {fuel.Fuel:F0}/{fuel.Props.fuelCapacity:F0}"); + } + + // 装载信息 + CompTransporter transporter = parentShuttle.GetComp(); + if (transporter != null) + { + statusText.AppendLine($"• 载重: {transporter.MassUsage:F1}/{transporter.Props.massCapacity:F1}"); + if (transporter.LoadingInProgress) + { + statusText.AppendLine("• 装载状态: 正在装载..."); + } + } + + // 口袋空间信息 + if (parentShuttle.pocketMapGenerated) + { + statusText.AppendLine($"• 内部空间: 已初始化"); + if (parentShuttle.innerContainer.Count > 0) + { + statusText.AppendLine($"• 内部储存: {parentShuttle.innerContainer.Count} 件物品"); + } + } + } + else + { + statusText.AppendLine("• 穿梭机正在飞行中,无法获取详细信息"); + } + + // 显示信息对话框 + Find.WindowStack.Add(new Dialog_MessageBox(statusText.ToString(), "WULA.PocketSpace.ShuttleStatus".Translate())); + } } } \ No newline at end of file diff --git a/Source/WulaFallenEmpire/WULA_Shuttle/PocketMapProperties.cs b/Source/WulaFallenEmpire/WULA_Shuttle/PocketMapProperties.cs new file mode 100644 index 00000000..d132951e --- /dev/null +++ b/Source/WulaFallenEmpire/WULA_Shuttle/PocketMapProperties.cs @@ -0,0 +1,12 @@ +using RimWorld; +using Verse; + +namespace WulaFallenEmpire +{ + public class PocketMapProperties : DefModExtension + { + public IntVec2 pocketMapSize = new IntVec2(13, 13); + public MapGeneratorDef mapGenerator; + public ThingDef exitDef; + } +} \ No newline at end of file