Beispiel #1
0
        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());
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        public static void CreateNPCConfigfile()
        {
            TNPCjsonhelper mem = new TNPCjsonhelper();

            mem.List = generateNPCList();
            string json = JsonConvert.SerializeObject(mem, Formatting.Indented);

            File.WriteAllText(NPCListPath, json.ToString());
        }