示例#1
0
        // Token: 0x06000033 RID: 51 RVA: 0x00003068 File Offset: 0x00001268
        public void InsertLayer(UndergroundMapParent mp)
        {
            int nextEmptyLayer = GetNextEmptyLayer(1);

            layersState.Add(nextEmptyLayer, mp);
            mp.depth = nextEmptyLayer;
        }
示例#2
0
        public void SyncConnectedMap()
        {
            UndergroundManager   undergroundManager   = Map.components.Find((MapComponent item) => item is UndergroundManager) as UndergroundManager;
            UndergroundMapParent undergroundMapParent = undergroundManager.layersState[targetedLevel];

            connectedMapParent = undergroundMapParent;
            connectedMap       = undergroundMapParent.Map;
            connectedLift      = (from Building_SpawnedLift lift in connectedMap.listerBuildings.allBuildingsColonist where lift is Building_SpawnedLift select lift).FirstOrDefault();
        }
示例#3
0
        // Token: 0x06000035 RID: 53 RVA: 0x00003158 File Offset: 0x00001358
        public void DestroyLayer(UndergroundMapParent layer)
        {
            int  depth = layer.depth;
            bool flag  = depth == -1;

            if (flag)
            {
                Log.Error("Destroyed layer doesn't have correct depth", false);
            }
            layersState.Remove(depth);
        }
示例#4
0
        // Token: 0x06000034 RID: 52 RVA: 0x00003094 File Offset: 0x00001294
        public void PinAllUnderground()
        {
            int num = 1;

            foreach (Building building in map.listerBuildings.allBuildingsColonist)
            {
                Building_MiningShaft building_MiningShaft;
                bool flag = (building_MiningShaft = (building as Building_MiningShaft)) != null && building_MiningShaft.IsConnected;
                if (flag)
                {
                    UndergroundMapParent linkedMapParent = building_MiningShaft.LinkedMapParent;
                    bool flag2 = linkedMapParent.depth == -1;
                    if (flag2)
                    {
                        while (layersState.ContainsKey(num))
                        {
                            num++;
                        }
                        layersState.Add(num, linkedMapParent);
                        linkedMapParent.depth = num;
                    }
                }
            }
        }
示例#5
0
        // Token: 0x0600000D RID: 13 RVA: 0x0000250C File Offset: 0x0000070C
        private void DrillToOldLayer()
        {
            UndergroundManager   undergroundManager   = Map.components.Find((MapComponent item) => item is UndergroundManager) as UndergroundManager;
            UndergroundMapParent undergroundMapParent = undergroundManager.layersState[targetedLevel];

            connectedMapParent = undergroundMapParent;
            connectedMap       = undergroundMapParent.Map;
            CellRect cellRect = this.OccupiedRect();
            IntVec3  intVec   = new IntVec3(cellRect.minX + 1, 0, cellRect.minZ + 1);

            connectedLift = GenSpawn.Spawn(ThingMaker.MakeThing(DefDatabase <ThingDef> .GetNamed("undergroundlift", true), Stuff), intVec, connectedMap, WipeMode.Vanish);
            connectedLift.SetFaction(Faction.OfPlayer, null);
            FloodFillerFog.FloodUnfog(intVec, connectedMap);
            bool flag = connectedLift is Building_SpawnedLift;

            if (flag)
            {
                ((Building_SpawnedLift)connectedLift).depth = connectedMapParent.depth;
            }
            else
            {
                Log.Warning("Spawned lift isn't deeprim's lift. Someone's editing this mod! And doing it badly!!! Very badly.", false);
            }
        }