Пример #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());
        }
Пример #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);
        }
Пример #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());
        }