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); }
public static void ShowJSON(EmoteTable emoteTable) { var jsonTable = new JSON.EmoteTable(emoteTable); var json = BuildJSON(jsonTable); Console.WriteLine(json); }
public static void OutputSQL(EmoteTable emoteTable, FileInfo sqlFile) { var sqlLines = BuildSQL(emoteTable); File.WriteAllLines(sqlFile.FullName, sqlLines); Console.WriteLine($"Compiled {sqlFile.FullName}"); }
public static void ShowSQL(EmoteTable emoteTable) { var sqlLines = BuildSQL(emoteTable); foreach (var sqlLine in sqlLines) { Console.WriteLine(sqlLines); } }
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); }
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); }
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); }
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); }
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); }
public static List <string> BuildSQL(EmoteTable emoteTable) { emoteTable.NormalRange(); return(EmoteScriptLib.SQL.SQLWriter.GetSQL(emoteTable)); }