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

            var json = BuildJSON(jsonTable);

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

            File.WriteAllLines(sqlFile.FullName, sqlLines);

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

            foreach (var sqlLine in sqlLines)
            {
                Console.WriteLine(sqlLines);
            }
        }
Exemple #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);
        }
Exemple #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);
        }
Exemple #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);
        }
Exemple #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);
        }
Exemple #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);
        }
Exemple #10
0
        public static List <string> BuildSQL(EmoteTable emoteTable)
        {
            emoteTable.NormalRange();

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