public JordGame() { Instance = this; _graphics = new GraphicsDeviceManager(this) { PreferredBackBufferWidth = 1440, PreferredBackBufferHeight = 900 }; IsMouseVisible = true; Window.AllowUserResizing = true; Window.Title = "Troubles of Jord"; TJ.GameLogHandler = message => { var asGameView = Desktop.Widgets[0] as GameView; if (asGameView == null) { return; } asGameView.LogView.Log(message); }; }
public static void Main(string[] args) { try { int?startGameIndex = null; foreach (var arg in args) { var match = ArgumentRegex.Match(arg); if (match != null && match.Success) { var command = match.Groups[1].Value.ToLower(); var value = match.Groups[2].Value; switch (command) { case "start": startGameIndex = int.Parse(value); break; } } } using (var game = new JordGame()) { game.StartGameIndex = startGameIndex; game.Run(); } } catch (Exception ex) { Console.WriteLine(ex); } }