Mirror of Svelto.ECS because we're a fan of it
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

161 lines
4.7KB

  1. using System;
  2. using Svelto.ECS.Internal;
  3. namespace Svelto.ECS
  4. {
  5. public interface IReactEngine : IEngine
  6. {
  7. }
  8. /// <summary>
  9. /// This is now considered legacy and it will be deprecated in future
  10. /// </summary>
  11. public interface IReactOnAdd : IReactEngine
  12. {
  13. }
  14. /// <summary>
  15. /// This is now considered legacy and it will be deprecated in future
  16. /// </summary>
  17. public interface IReactOnRemove : IReactEngine
  18. {
  19. }
  20. /// <summary>
  21. /// This is now considered legacy and it will be deprecated in future
  22. /// </summary>
  23. public interface IReactOnSwap : IReactEngine
  24. {
  25. }
  26. /// <summary>
  27. /// This is now considered legacy and it will be deprecated in future
  28. /// </summary>
  29. public interface IReactOnDispose : IReactEngine
  30. {
  31. }
  32. public interface IReactOnAddEx : IReactEngine
  33. {
  34. }
  35. public interface IReactOnRemoveEx : IReactEngine
  36. {
  37. }
  38. public interface IReactOnSwapEx : IReactEngine
  39. {
  40. }
  41. public interface IReactOnDisposeEx : IReactEngine
  42. {
  43. }
  44. }
  45. namespace Svelto.ECS
  46. {
  47. public interface IEngine
  48. {
  49. }
  50. public interface IGetReadyEngine : IEngine
  51. {
  52. void Ready();
  53. }
  54. public interface IQueryingEntitiesEngine : IGetReadyEngine
  55. {
  56. EntitiesDB entitiesDB { set; }
  57. }
  58. /// <summary>
  59. /// Interface to mark an Engine as reacting on entities added
  60. /// </summary>
  61. /// <typeparam name="T"></typeparam>
  62. [Obsolete]
  63. public interface IReactOnAdd<T> : IReactOnAdd where T : _IInternalEntityComponent
  64. {
  65. void Add(ref T entityComponent, EGID egid);
  66. }
  67. public interface IReactOnAddEx<T> : IReactOnAddEx where T : struct, _IInternalEntityComponent
  68. {
  69. void Add((uint start, uint end) rangeOfEntities, in EntityCollection<T> entities,
  70. ExclusiveGroupStruct groupID);
  71. }
  72. /// <summary>
  73. /// Interface to mark an Engine as reacting on entities removed
  74. /// </summary>
  75. /// <typeparam name="T"></typeparam>
  76. [Obsolete]
  77. public interface IReactOnRemove<T> : IReactOnRemove where T : _IInternalEntityComponent
  78. {
  79. void Remove(ref T entityComponent, EGID egid);
  80. }
  81. public interface IReactOnAddAndRemoveEx<T> : IReactOnAddEx<T>, IReactOnRemoveEx<T> where T : struct, _IInternalEntityComponent
  82. {
  83. }
  84. public interface IReactOnRemoveEx<T> : IReactOnRemoveEx where T : struct, _IInternalEntityComponent
  85. {
  86. void Remove((uint start, uint end) rangeOfEntities, in EntityCollection<T> entities,
  87. ExclusiveGroupStruct groupID);
  88. }
  89. [Obsolete("Use IReactOnAddEx<T> and IReactOnRemoveEx<T> or IReactOnAddAndRemoveEx<T> instead")]
  90. public interface IReactOnAddAndRemove<T> : IReactOnAdd<T>, IReactOnRemove<T> where T : _IInternalEntityComponent
  91. {
  92. }
  93. /// <summary>
  94. /// Interface to mark an Engine as reacting on engines root disposed.
  95. /// It can work together with IReactOnRemove which normally is not called on enginesroot disposed
  96. /// </summary>
  97. /// <typeparam name="T"></typeparam>
  98. [Obsolete("Use IReactOnDisposeEx<T> instead")]
  99. public interface IReactOnDispose<T> : IReactOnDispose where T : _IInternalEntityComponent
  100. {
  101. void Remove(ref T entityComponent, EGID egid);
  102. }
  103. /// <summary>
  104. /// Interface to mark an Engine as reacting to entities swapping group
  105. /// </summary>
  106. /// <typeparam name="T"></typeparam>
  107. [Obsolete("Use IReactOnSwapEx<T> instead")]
  108. public interface IReactOnSwap<T> : IReactOnSwap where T : _IInternalEntityComponent
  109. {
  110. void MovedTo(ref T entityComponent, ExclusiveGroupStruct previousGroup, EGID egid);
  111. }
  112. /// <summary>
  113. /// All the entities have been already submitted in the database (swapped) when this callback is triggered
  114. /// </summary>
  115. /// <typeparam name="T"></typeparam>
  116. public interface IReactOnSwapEx<T> : IReactOnSwapEx where T : struct, _IInternalEntityComponent
  117. {
  118. void MovedTo((uint start, uint end) rangeOfEntities, in EntityCollection<T> entities,
  119. ExclusiveGroupStruct fromGroup, ExclusiveGroupStruct toGroup);
  120. }
  121. public interface IReactOnDisposeEx<T> : IReactOnDisposeEx where T : struct, _IInternalEntityComponent
  122. {
  123. void Remove((uint start, uint end) rangeOfEntities, in EntityCollection<T> entities,
  124. ExclusiveGroupStruct groupID);
  125. }
  126. /// <summary>
  127. /// Interface to mark an Engine as reacting after each entities submission phase
  128. /// </summary>
  129. public interface IReactOnSubmission : IReactEngine
  130. {
  131. void EntitiesSubmitted();
  132. }
  133. public interface IReactOnSubmissionStarted : IReactEngine
  134. {
  135. void EntitiesSubmissionStarting();
  136. }
  137. }