예제 #1
0
 public CommandRunner(ESDOptions options, ESDOptions.Option opt)
 {
     this.options = options;
     this.opt     = opt;
     this.spec    = options.Spec;
     this.editor  = new GameEditor(spec);
     this.scraper = new Scraper(spec);
     this.u       = new Universe();
 }
예제 #2
0
파일: Program.cs 프로젝트: vawser/ESDLang
 static void Main(string[] args)
 {
     if (args.Length == 0)
     {
         Console.WriteLine(ESDOptions.GetShortUsage());
     }
     else if (args.Contains("-h") || args.Contains("-H"))
     {
         Console.WriteLine(ESDOptions.GetUsage());
     }
     else
     {
         ESDOptions options;
         try
         {
             options = ESDOptions.Parse(args);
         }
         catch (Exception e)
         {
             Console.WriteLine($"ERROR: {e.Message}");
             Console.WriteLine();
             Console.WriteLine(ESDOptions.GetShortUsage());
             return;
         }
         while (true)
         {
             ESDOptions.Option opt;
             try
             {
                 opt = options.NextAction();
             }
             catch (Exception e)
             {
                 Console.WriteLine($"Error processing command: {e.Message}");
                 return;
             }
             if (opt == null)
             {
                 break;
             }
             new CommandRunner(options, opt).Run();
         }
     }
 }