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)); } } } }
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); } } }