Game.cs 777 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using Model;
  2. namespace Hotfix
  3. {
  4. public static class Game
  5. {
  6. private static EntityEventManager entityEventManager;
  7. public static TPoller Poller { get; } = new TPoller();
  8. private static Scene scene;
  9. public static Scene Scene
  10. {
  11. get
  12. {
  13. if (scene == null)
  14. {
  15. scene = new Scene();
  16. scene.AddComponent<EventComponent>();
  17. scene.AddComponent<TimerComponent>();
  18. }
  19. return scene;
  20. }
  21. }
  22. public static void CloseScene()
  23. {
  24. scene.Dispose();
  25. scene = null;
  26. }
  27. public static EntityEventManager EntityEventManager
  28. {
  29. get
  30. {
  31. if (entityEventManager == null)
  32. {
  33. entityEventManager = new EntityEventManager();
  34. }
  35. return entityEventManager;
  36. }
  37. set
  38. {
  39. entityEventManager = value;
  40. }
  41. }
  42. }
  43. }