Program.cs 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. #region File Description
  2. //-----------------------------------------------------------------------------
  3. // Program.cs
  4. //
  5. //-----------------------------------------------------------------------------
  6. #endregion
  7. #region License
  8. /*
  9. Microsoft Public License (Ms-PL)
  10. MonoGame - Copyright © 2009 The MonoGame Team
  11. All rights reserved.
  12. This license governs use of the accompanying software. If you use the software, you accept this license. If you do not
  13. accept the license, do not use the software.
  14. 1. Definitions
  15. The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under
  16. U.S. copyright law.
  17. A "contribution" is the original software, or any additions or changes to the software.
  18. A "contributor" is any person that distributes its contribution under this license.
  19. "Licensed patents" are a contributor's patent claims that read directly on its contribution.
  20. 2. Grant of Rights
  21. (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3,
  22. each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.
  23. (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3,
  24. each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.
  25. 3. Conditions and Limitations
  26. (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
  27. (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software,
  28. your patent license from such contributor to the software ends automatically.
  29. (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution
  30. notices that are present in the software.
  31. (D) If you distribute any portion of the software in source code form, you may do so only under this license by including
  32. a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object
  33. code form, you may only do so under a license that complies with this license.
  34. (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees
  35. or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent
  36. permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular
  37. purpose and non-infringement.
  38. */
  39. #endregion License
  40. 
  41. #region Using Statements
  42. using System;
  43. using Microsoft.Xna.Framework;
  44. using Microsoft.Xna.Framework.GamerServices;
  45. using Microsoft.Xna.Framework.Graphics;
  46. using Microsoft.Xna.Framework.Input;
  47. using Microsoft.Xna.Framework.Net;
  48. using MonoMac.Foundation;
  49. using MonoMac.AppKit;
  50. using MonoMac.ObjCRuntime;
  51. #endregion
  52. namespace RolePlaying
  53. {
  54. #region Entry Point
  55. static class Program
  56. {
  57. /// <summary>
  58. /// The main entry point for the application.
  59. /// </summary>
  60. static void Main (string[] args)
  61. {
  62. NSApplication.Init ();
  63. using (var p = new NSAutoreleasePool ()) {
  64. NSApplication.SharedApplication.Delegate = new AppDelegate();
  65. NSApplication.Main(args);
  66. }
  67. }
  68. }
  69. class AppDelegate : NSApplicationDelegate
  70. {
  71. RolePlayingGame game;
  72. public override void FinishedLaunching (MonoMac.Foundation.NSObject notification)
  73. {
  74. game = new RolePlayingGame();
  75. game.Run();
  76. }
  77. public override bool ApplicationShouldTerminateAfterLastWindowClosed (NSApplication sender)
  78. {
  79. return true;
  80. }
  81. }
  82. #endregion
  83. }