Exemplo n.º 1
0
        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.");
            }
        }