Program.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using System;
  2. using MonoMac.Foundation;
  3. using MonoMac.AppKit;
  4. using MonoMac.ObjCRuntime;
  5. namespace Flood_Control
  6. {
  7. #if WINDOWS || XBOX
  8. static class Program
  9. {
  10. /// <summary>
  11. /// The main entry point for the application.
  12. /// </summary>
  13. static void Main(string[] args)
  14. {
  15. using (Game1 game = new Game1())
  16. {
  17. game.Run();
  18. }
  19. }
  20. }
  21. #else
  22. static class Program
  23. {
  24. /// <summary>
  25. /// The main entry point for the application.
  26. /// </summary>
  27. static void Main (string[] args)
  28. {
  29. NSApplication.Init ();
  30. using (var p = new NSAutoreleasePool ()) {
  31. NSApplication.SharedApplication.Delegate = new AppDelegate();
  32. NSApplication.Main(args);
  33. }
  34. }
  35. }
  36. class AppDelegate : NSApplicationDelegate
  37. {
  38. Game1 game;
  39. public override void FinishedLaunching (MonoMac.Foundation.NSObject notification)
  40. {
  41. game = new Game1();
  42. game.Run();
  43. }
  44. public override bool ApplicationShouldTerminateAfterLastWindowClosed (NSApplication sender)
  45. {
  46. return true;
  47. }
  48. }
  49. #endif
  50. }