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

            var json = BuildJSON(jsonTable);

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

            File.WriteAllLines(sqlFile.FullName, sqlLines);

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

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

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