static void Main(string[] args) { try { var options = new Options(); if (!Parser.Default.ParseArguments(args, options)) { return; } if (options.ShowRules) { IRulePrinter printer = new ConsolePrinter(); printer.PrintRules(GameRules); printer = new MarkdownPrinter(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "rules.md")); printer.PrintRules(GameRules); printer = new HtmlPrinter(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "rules.html")); printer.PrintRules(GameRules); return; } Console.WriteLine("Starting new game"); var game = new BombermanGame(); if (options.ConsoleLogger) { game.Logger = new CombinedLogger(new InMemoryLogger(), new ConsoleLogger()); } game.StartNewGame(options); } catch (Exception ex) { Console.WriteLine(ex); } }
static void Main() { using (var game = BombermanGame.getInstance()) game.Run(); }