public static BasicGameCommand GetBasicGameCommand(this ISimpleGame payLoad, string commandName) { string functionName = $"Can{commandName}"; functionName = functionName.Replace("Async", ""); MethodInfo?method = payLoad.GetPrivateMethod(commandName); if (method == null) { Type type = payLoad.GetType(); throw new BasicBlankException($"Method with the name of {commandName} was not found Type was {type.Name}"); } MethodInfo? fun = payLoad.GetPrivateMethod(functionName); BasicGameCommand output; if (fun != null) { output = new BasicGameCommand(payLoad, method, canExecuteM: fun, payLoad.CommandContainer); } else { PropertyInfo?pp = payLoad.GetPrivateProperty(functionName); output = new BasicGameCommand(payLoad, method, canExecute: pp, payLoad.CommandContainer); } return(output); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. _spriteBatch = new SpriteBatch(GraphicsDevice); // UNCOMMENT THE GAME HERE _game = new TopDown(Window, Content); //_game = new SurfingGame(Window, Content); //_game = new RpgGame(Window, Content); //_game = new TwitchGame(Window, Content); if (IsNetworkGame) { _broadcastClient = new BroadcastClient(); } }
/// <summary> /// /// </summary> /// <param name="dispString">String to display in GameOverWindow.</param> /// <param name="invokedBy">The window implementing ISimpleGame that called this constructor.</param> public GameOverWindow(string dispString, ISimpleGame invokedBy) { this.invokedBy = invokedBy; InitializeComponent(); EndTextBlock.Text = dispString; }