Game.cs 539 B

1234567891011121314151617181920212223242526272829303132333435
  1. using System.Collections.Generic;
  2. using System.Linq;
  3. using System.Text;
  4. using Base;
  5. namespace Model
  6. {
  7. public static class Game
  8. {
  9. public static TPoller Poller { get; } = new TPoller();
  10. private static Scene scene;
  11. public static Scene Scene
  12. {
  13. get
  14. {
  15. if (scene != null)
  16. {
  17. return scene;
  18. }
  19. scene = new Scene();
  20. scene.AddComponent<EventComponent>();
  21. scene.AddComponent<TimerComponent>();
  22. return scene;
  23. }
  24. }
  25. public static void Close()
  26. {
  27. scene.Dispose();
  28. scene = null;
  29. }
  30. }
  31. }