private static void HandleCommand() { Console.Write("> "); FlushInput(); string rawInput = Console.ReadLine(); // Split command string[] command = rawInput.Split(' '); switch (command[0]) { case "exit": Environment.Exit(0); break; case "help": DisplayHelpMessage(); break; case "reload": Console.WriteLine("Reloading configuration..."); config = new GeneratorConfig(); break; case "generate": generator = new InfoGenerator(config); if (generator.IsValid) { Console.WriteLine("[RIG] All components ready."); Console.WriteLine("[RIG] Bus Route TS will be exported to: " + config.ExportLoc_BusRoutes); Console.WriteLine("[RIG] Waypoint TS will be exported to: " + config.ExportLoc_Waypoints); Console.WriteLine("[RIG] Type in the command once more as confirmation."); FlushInput(); if (Console.ReadLine() == "generate") { Console.WriteLine("[RIG] Operation confirmed."); generator.GenerateFiles(); } else { Console.WriteLine("[RIG] Operation cancelled."); } } break; default: Console.WriteLine("Unknown command. Type \"help\" for a list of commands."); break; } }
public InfoGenerator(GeneratorConfig config) { this.config = config; PreloadAndVerify(); Instance = this; }