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.

36 lines
2.4KB

  1. using System.Runtime.CompilerServices;
  2. namespace Svelto.ECS
  3. {
  4. public interface IEntityFunctions
  5. {
  6. /// <summary>
  7. /// Remove an entity from the database. Since Svelto.ECS 3.5 Removal operation behaves like this:
  8. /// * Remove supersedes a previous Remove operation on the same submission frame
  9. /// * Remove supersedes a previous Swap operation on the same submission frame if the egid is used a origin (fromEGID) - similar to the remove case
  10. /// * Remove throws an exception if a Build operation with the same egid is done on the same submission frame
  11. /// * Remove throws an exception if called on an EGID used as destination (toEGID) for a swap - similare to the build case
  12. /// </summary>
  13. void RemoveEntity<T>(uint entityID, ExclusiveBuildGroup groupID, [CallerMemberName] string caller = null) where T : IEntityDescriptor, new();
  14. void RemoveEntity<T>(EGID entityegid, [CallerMemberName] string caller = null) where T : IEntityDescriptor, new();
  15. /// <summary>
  16. /// Swap an entity between groups (subset of entities). Only one structural operation per submission frame is allowed.
  17. /// </summary>
  18. void SwapEntityGroup<T>(uint entityID, ExclusiveBuildGroup fromGroupID, ExclusiveBuildGroup toGroupID,
  19. [CallerMemberName] string caller = null) where T : IEntityDescriptor, new();
  20. void SwapEntityGroup<T>(EGID fromEGID, ExclusiveBuildGroup toGroupID, [CallerMemberName] string caller = null)
  21. where T : IEntityDescriptor, new();
  22. void SwapEntityGroup<T>(EGID fromEGID, EGID toEGID, [CallerMemberName] string caller = null) where T : IEntityDescriptor, new();
  23. void SwapEntityGroup<T>(EGID fromEGID, EGID toEGID, ExclusiveBuildGroup mustBeFromGroup, [CallerMemberName] string caller = null)
  24. where T : IEntityDescriptor, new();
  25. void RemoveEntitiesFromGroup(ExclusiveBuildGroup groupID, [CallerMemberName] string caller = null);
  26. void SwapEntitiesInGroup(ExclusiveBuildGroup fromGroupID, ExclusiveBuildGroup toGroupID, [CallerMemberName] string caller = null);
  27. #if UNITY_NATIVE
  28. Svelto.ECS.Native.NativeEntityRemove ToNativeRemove<T>(string memberName) where T : IEntityDescriptor, new();
  29. Svelto.ECS.Native.NativeEntitySwap ToNativeSwap<T>(string memberName) where T : IEntityDescriptor, new();
  30. #endif
  31. }
  32. }