コード例 #1
0
ファイル: Converter.cs プロジェクト: sLackeR-hub/EmoteScript
        public static void json2es(FileInfo jsonFile)
        {
            var settings = new JsonSerializerSettings();

            settings.ContractResolver = new JSON.LowercaseContractResolver();

            var json = File.ReadAllText(jsonFile.FullName);

            var jsonEmoteTable = JsonConvert.DeserializeObject <JSON.EmoteTable>(json, settings);

            var emoteTable = new EmoteTable(jsonEmoteTable);

            emoteTable.SetValidBranches();

            emoteTable.BuildLinks();

            //ShowScript(emoteTable.EmoteSets);

            var esFilename = Path.ChangeExtension(jsonFile.FullName, ".es");

            // check if file already exists?

            var esFile = new FileInfo(esFilename);

            OutputScript(emoteTable.EmoteSets, esFile);
        }
コード例 #2
0
ファイル: Converter.cs プロジェクト: sLackeR-hub/EmoteScript
        public static List <string> json2es(string json)
        {
            var settings = new JsonSerializerSettings();

            settings.ContractResolver = new JSON.LowercaseContractResolver();

            var jsonEmoteTable = JsonConvert.DeserializeObject <JSON.EmoteTable>(json, settings);

            var emoteTable = new EmoteTable(jsonEmoteTable);

            emoteTable.SetValidBranches();

            emoteTable.BuildLinks();

            var esLines = BuildScript(emoteTable.EmoteSets);

            return(esLines);
        }