Пример #1
0
        public static void ShowJSON(EmoteTable emoteTable)
        {
            var jsonTable = new JSON.EmoteTable(emoteTable);

            var json = BuildJSON(jsonTable);

            Console.WriteLine(json);
        }
Пример #2
0
        public static void OutputJSON(JSON.EmoteTable emoteTable, FileInfo jsonFile)
        {
            var json = BuildJSON(emoteTable);

            File.WriteAllText(jsonFile.FullName, json);

            Console.WriteLine($"Compiled {jsonFile.FullName}");
        }
Пример #3
0
        public static string BuildJSON(JSON.EmoteTable emoteTable)
        {
            var settings = new JsonSerializerSettings();

            settings.NullValueHandling = NullValueHandling.Ignore;
            settings.Formatting        = Formatting.Indented;
            //settings.ContractResolver = new LowercaseContractResolver();

            return(JsonConvert.SerializeObject(emoteTable, settings));
        }
Пример #4
0
        public static void es2json(EmoteTable emoteTable, FileInfo esFile)
        {
            var jsonFilename = Path.ChangeExtension(esFile.FullName, ".json");
            var jsonFile     = new FileInfo(jsonFilename);

            emoteTable.NormalRange();

            var jsonTable = new JSON.EmoteTable(emoteTable);

            // check if file already exists?

            // output json file
            OutputJSON(jsonTable, jsonFile);
        }