public static void Main(string[] args) { if (args.Length != 0 && args[0] == "--reparse") { Reparse(); return; } if (args.Length != 0 && args[0] == "--massparse") { Massparse(); return; } else if (args.Length != 0 && File.Exists(args[0])) { Heatmap h = new Heatmap( Database, File.OpenRead(args[0]), null ); h.ParseHeaderOnly(); var result = h.ParseTheRest(); Database.Save <DemoAnalysis>(result); } else if (args.Length != 0 && Directory.Exists(args[0])) { List <string> urls = new List <string>(); foreach (var file in Directory.GetFiles(args[0], "*.dem")) { Console.WriteLine("Parsing file " + file); Heatmap h = new Heatmap( Database, File.OpenRead(file), null ); h.ParseHeaderOnly(); var result = h.ParseTheRest(); result.DemoFile = Path.GetFileName(file); Database.Save <DemoAnalysis>(result); Console.WriteLine("Saved as " + result.ID); urls.Add(result.ID.ToString()); } Console.WriteLine("URL: "); Console.WriteLine(string.Join(",", urls)); } else { Console.WriteLine("Args: Either --reparse, or a file. "); } }
static void ParseDemo() { var ana = currentAna; ana.Participants.Clear(); ana.Progress = 0; ana.Rounds = new System.Collections.Generic.List <RoundEventMap>(); ana.IsFinished = false; Heatmap h = new Heatmap( Database, File.OpenRead(Path.Combine("demo/", ana.DemoFile)), ana.Overview, ana ); h.ParseHeaderOnly(); var result = h.ParseTheRest(); currentAna = result; }