Program.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using Foundation;
  2. using UIKit;
  3. namespace Shooter.iOS
  4. {
  5. [Register("AppDelegate")]
  6. internal class AppDelegate : UIApplicationDelegate
  7. {
  8. private static ShooterGame _game;
  9. /// <summary>
  10. /// Initializes and starts the game by creating an instance of the
  11. /// Game class and invoking its Run method.
  12. /// </summary>
  13. internal static void RunGame()
  14. {
  15. _game = new ShooterGame();
  16. _game.Run();
  17. }
  18. /// <summary>
  19. /// Called when the application has finished launching.
  20. /// This method starts the game by calling RunGame.
  21. /// </summary>
  22. /// <param name="app">The UIApplication instance representing the application.</param>
  23. public override void FinishedLaunching(UIApplication app)
  24. {
  25. RunGame();
  26. }
  27. /// <summary>
  28. /// The main entry point for the application.
  29. /// This sets up the application and specifies the UIApplicationDelegate
  30. /// class to handle application lifecycle events.
  31. /// </summary>
  32. /// <param name="args">Command-line arguments passed to the application.</param>
  33. static void Main(string[] args)
  34. {
  35. UIApplication.Main(args, null, typeof(AppDelegate));
  36. }
  37. }
  38. }