コード例 #1
0
        //Terrain instance

        public static TerrainInstance MakeTerrainInstance(this ActiveTerrainDef tDef, Map map, IntVec3 loc)
        {
            var terr = (TerrainInstance)Activator.CreateInstance(tDef.terrainInstanceClass);

            terr.def      = tDef;
            terr.Map      = map;
            terr.Position = loc;
            return(terr);
        }
コード例 #2
0
 public void RegisterAt(ActiveTerrainDef special, IntVec3 cell)
 {
     if (!terrains.ContainsKey(cell))
     {
         var newTerr = special.MakeTerrainInstance(map, cell);
         newTerr.Init();
         terrainInstances.Add(newTerr);
         terrains.Add(cell, newTerr);
         this.terrainDefs.Add(special);
         FixAt(terrainInstances.Count);
     }
 }
コード例 #3
0
 public void RegisterAt(ActiveTerrainDef special, int i)
 {
     RegisterAt(special, map.cellIndices.IndexToCell(i));
 }