Mirror of Svelto.ECS because we're a fan of it
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.0KB

  1. namespace Svelto.ECS.Schedulers
  2. {
  3. public class EntitiesSubmissionScheduler
  4. {
  5. public bool paused { get; set; }
  6. public uint iteration { get; protected internal set; }
  7. internal bool isRunning;
  8. protected internal EnginesRoot.EntitiesSubmitter onTick
  9. {
  10. set
  11. {
  12. DBC.ECS.Check.Require(_entitiesSubmitter == null, "a scheduler can be exclusively used by one enginesRoot only");
  13. _entitiesSubmitter = value;
  14. }
  15. }
  16. public void Dispose() { }
  17. [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
  18. public void SubmitEntities()
  19. {
  20. try
  21. {
  22. _entitiesSubmitter.Value.SubmitEntities();
  23. }
  24. catch
  25. {
  26. paused = true;
  27. throw;
  28. }
  29. }
  30. EnginesRoot.EntitiesSubmitter? _entitiesSubmitter;
  31. }
  32. }