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.

38 lines
918B

  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. public void SubmitEntities()
  18. {
  19. try
  20. {
  21. _entitiesSubmitter.Value.SubmitEntities();
  22. }
  23. catch
  24. {
  25. paused = true;
  26. throw;
  27. }
  28. }
  29. EnginesRoot.EntitiesSubmitter? _entitiesSubmitter;
  30. }
  31. }