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.

47 lines
2.2KB

  1. using Svelto.DataStructures;
  2. using Svelto.Utilities;
  3. namespace Svelto.ECS
  4. {
  5. public interface IEntitiesDB
  6. {
  7. /// <summary>
  8. /// All the EntityView related methods are left for back compatibility, but
  9. /// shouldn't be used anymore. Always pick EntityViewStruct or EntityStruct
  10. /// over EntityView
  11. /// </summary>
  12. ReadOnlyCollectionStruct<T> QueryEntityViews<T>() where T : class, IEntityStruct;
  13. /// <summary>
  14. /// All the EntityView related methods are left for back compatibility, but
  15. /// shouldn't be used anymore. Always pick EntityViewStruct or EntityStruct
  16. /// over EntityView
  17. /// </summary>
  18. ReadOnlyCollectionStruct<T> QueryEntityViews<T>(int group) where T : class, IEntityStruct;
  19. /// <summary>
  20. /// All the EntityView related methods are left for back compatibility, but
  21. /// shouldn't be used anymore. Always pick EntityViewStruct or EntityStruct
  22. /// over EntityView
  23. /// </summary>
  24. bool TryQueryEntityView<T>(EGID egid, out T entityView) where T : class, IEntityStruct;
  25. /// <summary>
  26. /// All the EntityView related methods are left for back compatibility, but
  27. /// shouldn't be used anymore. Always pick EntityViewStruct or EntityStruct
  28. /// over EntityView
  29. /// </summary>
  30. T QueryEntityView<T>(EGID egid) where T : class, IEntityStruct;
  31. //to use with EntityViews, EntityStructs and EntityViewStructs
  32. T[] QueryEntities<T>(out int count) where T : IEntityStruct;
  33. T[] QueryEntities<T>(int group, out int count) where T : IEntityStruct;
  34. T[] QueryEntitiesAndIndex<T>(EGID entityGid, out uint index) where T : IEntityStruct;
  35. //to use with EntityViews, EntityStructs and EntityViewStructs
  36. void ExecuteOnEntity<T, W>(EGID egid, ref W value, ActionRef<T, W> action) where T : IEntityStruct;
  37. void ExecuteOnEntity<T>(EGID egid, ActionRef<T> action) where T : IEntityStruct;
  38. bool Exists<T>(EGID egid) where T : IEntityStruct;
  39. bool HasAny<T>() where T:IEntityStruct;
  40. bool HasAny<T>(int group) where T:IEntityStruct;
  41. }
  42. }