using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Text.Json; using System.Threading.Tasks; namespace Better_NCP_Editor { public static class JsonDictionaryLoader { public static Dictionary Load(string filePath) { if (!File.Exists(filePath)) throw new FileNotFoundException("The specified JSON file was not found.", filePath); string json = File.ReadAllText(filePath); Dictionary dictionary = JsonSerializer.Deserialize>(json); return dictionary; } public static Dictionary> LoadSkinDict(string filePath) { if (!File.Exists(filePath)) throw new FileNotFoundException("The specified JSON file was not found.", filePath); string json = File.ReadAllText(filePath); Dictionary> dictionary = JsonSerializer.Deserialize>>(json); return dictionary; } } public static class JsonListLoader { public static List Load(string filePath) { if (!File.Exists(filePath)) throw new FileNotFoundException("The specified JSON file was not found.", filePath); string json = File.ReadAllText(filePath); List list = JsonSerializer.Deserialize>(json); return list; } } }