Ejemplo n.º 1
0
 public static void RegenerateAtlas()
 {
     _tileMap = new Dictionary <string, TileDef>();
     foreach (var mod in ModMap.GetEnabledMods())
     {
         if (mod.IsProvidingTileDefs)
         {
             var filenames = Directory.GetFiles(mod.TileDefsPath, "*.json");
             foreach (var filename in filenames)
             {
                 var jsonString = File.ReadAllText(filename);
                 var def        = JsonConvert.DeserializeObject <SerializableTileDef>(jsonString);
                 _tileMap.Add(def.Name, def.ToTileUnifiedDef(mod));
             }
         }
     }
 }
Ejemplo n.º 2
0
        private static void CreateAtlas()
        {
            rooms = new Dictionary <string, Room>();
            foreach (var mod in ModMap.GetEnabledMods())
            {
                if (!mod.IsProvidingRooms)
                {
                    continue;
                }

                foreach (var path in mod.RoomPaths)
                {
                    var data  = File.ReadAllText(path);
                    var sRoom = JsonConvert.DeserializeObject <SerializableRoom>(data);
                    var room  = new Room(sRoom);
                    rooms.Add(room.Name, room);
                }
            }
        }