예제 #1
0
        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
        public static void ShowJSON(EmoteTable emoteTable)
        {
            var jsonTable = new JSON.EmoteTable(emoteTable);

            var json = BuildJSON(jsonTable);

            Console.WriteLine(json);
        }
예제 #3
0
        public static void OutputSQL(EmoteTable emoteTable, FileInfo sqlFile)
        {
            var sqlLines = BuildSQL(emoteTable);

            File.WriteAllLines(sqlFile.FullName, sqlLines);

            Console.WriteLine($"Compiled {sqlFile.FullName}");
        }
예제 #4
0
        public static void ShowSQL(EmoteTable emoteTable)
        {
            var sqlLines = BuildSQL(emoteTable);

            foreach (var sqlLine in sqlLines)
            {
                Console.WriteLine(sqlLines);
            }
        }
예제 #5
0
        public static void es2sql(EmoteTable emoteTable, FileInfo esFile)
        {
            var sqlFilename = Path.ChangeExtension(esFile.FullName, ".sql");
            var sqlFile     = new FileInfo(sqlFilename);

            // check if file already exists?

            // output sql file
            OutputSQL(emoteTable, sqlFile);
        }
예제 #6
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);
        }
예제 #7
0
        public static List <string> es2sql(string[] esLines, uint?wcid = null)
        {
            var emoteTable = new EmoteTable();

            emoteTable.EmoteSets = Parser.ParseLines(esLines);

            if (emoteTable.EmoteSets == null)
            {
                return(null);
            }

            emoteTable.Wcid = wcid;

            var sqlLines = BuildSQL(emoteTable);

            return(sqlLines);
        }
예제 #8
0
        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);
        }
예제 #9
0
        public static string es2json(string[] esLines, uint?wcid = null)
        {
            var emoteTable = new EmoteTable();

            emoteTable.EmoteSets = Parser.ParseLines(esLines);

            if (emoteTable.EmoteSets == null)
            {
                return(null);
            }

            emoteTable.Wcid = wcid;

            emoteTable.NormalRange();

            var jsonTable = new JSON.EmoteTable(emoteTable);

            var jsonLines = BuildJSON(jsonTable);

            return(jsonLines);
        }
예제 #10
0
        public static List <string> BuildSQL(EmoteTable emoteTable)
        {
            emoteTable.NormalRange();

            return(EmoteScriptLib.SQL.SQLWriter.GetSQL(emoteTable));
        }