Beispiel #1
0
        // Token: 0x0600002D RID: 45 RVA: 0x00002B98 File Offset: 0x00000D98
        public void Notify_RemovedTerrainAt(IntVec3 c)
        {
            TerrainInstance terrainInstance = this.terrains[c];

            this.terrains.Remove(c);
            terrainInstance.PostRemove();
        }
        // Token: 0x0600000B RID: 11 RVA: 0x00002348 File Offset: 0x00000548
        public static TerrainInstance MakeTerrainInstance(this SpecialTerrain tDef, Map map, IntVec3 loc)
        {
            TerrainInstance terrainInstance = (TerrainInstance)Activator.CreateInstance(tDef.terrainInstanceClass);

            terrainInstance.def      = tDef;
            terrainInstance.Map      = map;
            terrainInstance.Position = loc;
            return(terrainInstance);
        }
Beispiel #3
0
        // Token: 0x0600002B RID: 43 RVA: 0x00002AE8 File Offset: 0x00000CE8
        public void RegisterAt(SpecialTerrain special, IntVec3 cell)
        {
            bool flag = !this.terrains.ContainsKey(cell);

            if (flag)
            {
                TerrainInstance terrainInstance = special.MakeTerrainInstance(this.map, cell);
                terrainInstance.Init();
                this.terrains.Add(cell, terrainInstance);
            }
        }
Beispiel #4
0
        // Token: 0x06000011 RID: 17 RVA: 0x00002494 File Offset: 0x00000694
        public static string HandleLabelQuery(TerrainDef def, IntVec3 loc, Map map)
        {
            bool   flag = def is SpecialTerrain;
            string result;

            if (flag)
            {
                TerrainInstance terrainInstance = map.GetComponent <SpecialTerrainList>().terrains[loc];
                bool            flag2           = terrainInstance.def != def;
                if (flag2)
                {
                    Log.Warning(string.Format("ActiveTerrain :: Got terrain instance at tile {0} but def of terrain instance ({1}) isn't equal to the def on the mouseover readout ({2}). Using the former.", loc, terrainInstance.def.defName, def.defName), false);
                }
                result = terrainInstance.Label;
            }
            else
            {
                result = def.LabelCap;
            }
            return(result);
        }
        // Token: 0x06000008 RID: 8 RVA: 0x000021D4 File Offset: 0x000003D4
        public static bool Powered(this TerrainInstance t)
        {
            var comp = t.GetComp <TerrainComp_PowerTrader>();

            return(comp == null || comp.PowerOn);
        }
 public static bool Powered(this TerrainInstance t)
 {
     return(t.GetComp <TerrainComp_PowerTrader>()?.PowerOn ?? true);
 }