public static void OverwriteNPCConfig(List <TNPC> NPCList) { TNPCjsonhelper mem = new TNPCjsonhelper(); mem.List = NPCList; string json = JsonConvert.SerializeObject(mem, Formatting.Indented); File.WriteAllText(NPCListPath, json.ToString()); }
public static List <TNPC> getNPCConfig() { List <TNPC> mem = new List <TNPC>(); JObject o1 = JObject.Parse(File.ReadAllText(NPCListPath)); TNPCjsonhelper read = o1.ToObject <TNPCjsonhelper>(); mem = read.List; return(mem); }
public static void CreateNPCConfigfile() { TNPCjsonhelper mem = new TNPCjsonhelper(); mem.List = generateNPCList(); string json = JsonConvert.SerializeObject(mem, Formatting.Indented); File.WriteAllText(NPCListPath, json.ToString()); }