private static void ParameterOk(Parameters parameters) { if (!Directory.Exists(parameters.PatchPath)) { throw new DirectoryNotFoundException(); } ArchiveManager.Initialise(parameters.PatchPath); GameTableManager.Initialise(); if (parameters.Extract) { ExtractionManager.Initialise(); } if (parameters.Generate) { GenerationManager.Initialise(); var start = DateTime.UtcNow; if (parameters.WorldId.HasValue) { GenerationManager.GenerateWorld(parameters.WorldId.Value, parameters.GridX, parameters.GridY); } else { GenerationManager.GenerateWorlds(true); } TimeSpan span = DateTime.UtcNow - start; log.Info($"Generated base maps in {span.TotalSeconds}s."); } }
private static void Main(string[] args) { Console.Title = Title; if (args.Length == 0) { throw new ArgumentException(); } if (!Directory.Exists(args[0])) { throw new DirectoryNotFoundException(); } Flags flags = Flags.Extration | Flags.Generation; if (args.Length == 2) { flags = (Flags)uint.Parse(args[1]); } ArchiveManager.Initialise(args[0]); GameTableManager.Initialise(); if ((flags & Flags.Extration) != 0) { ExtractionManager.Initialise(); } if ((flags & Flags.Generation) != 0) { GenerationManagaer.Initialise(); } log.Info("Finished!"); Console.ReadLine(); }