/// <summary> /// Create a game instance and run it. /// At each draw call, the provided <paramref name="oneLoopTurnActionBfrUpdate"/> and <paramref name="oneLoopTurnActionAftUpdate"/> /// functions will be given as parameters respectly the <see cref="Game"/> instance, the loopCount counter and the loopCount sum. /// </summary> /// <param name="onLoading">The callback that will be called in the <see cref="Game.LoadContent"/> method.</param> /// <param name="oneLoopTurnActionBfrUpdate">The callback that will be called before each <see cref="GameBase.Update"/> calls.</param> /// <param name="oneLoopTurnActionAftUpdate">The callback that will be called after each <see cref="GameBase.Update"/> calls.</param> static public void ExecuteScriptInDrawLoop(Action <Game> onLoading, Action <Game, int, int> oneLoopTurnActionBfrUpdate, Action <Game, int, int> oneLoopTurnActionAftUpdate = null) { var loopCountClass = new LoopCountClass(oneLoopTurnActionBfrUpdate, oneLoopTurnActionAftUpdate); CreateAndRunGame(onLoading, null, null, loopCountClass.OneLoopTurnActionBfrUpdate, loopCountClass.OneLoopTurnActionAftUpdate); }
/// <summary> /// Create a game instance and run it. /// At each draw call, the provided <paramref name="oneLoopTurnActionBfrUpdate"/> and <paramref name="oneLoopTurnActionAftUpdate"/> /// functions will be given as parameters respectly the <see cref="Game"/> instance, the loopCount counter and the loopCount sum. /// </summary> /// <param name="onLoading">The callback that will be called in the <see cref="Game.LoadContent"/> method.</param> /// <param name="oneLoopTurnActionBfrUpdate">The callback that will be called before each <see cref="GameBase.Update"/> calls.</param> /// <param name="oneLoopTurnActionAftUpdate">The callback that will be called after each <see cref="GameBase.Update"/> calls.</param> static public void ExecuteScriptInDrawLoop(Action<Game> onLoading, Action<Game, int, int> oneLoopTurnActionBfrUpdate, Action<Game, int, int> oneLoopTurnActionAftUpdate = null) { var loopCountClass = new LoopCountClass(oneLoopTurnActionBfrUpdate, oneLoopTurnActionAftUpdate); CreateAndRunGame(onLoading, null, null, loopCountClass.OneLoopTurnActionBfrUpdate, loopCountClass.OneLoopTurnActionAftUpdate); }