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.

IEngine.cs 1.7KB

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. using Rewired.Utils;
  2. using Svelto.ECS.Internal;
  3. namespace Svelto.ECS.Internal
  4. {
  5. public interface IStructNodeEngine : IEngine
  6. {
  7. void CreateStructNodes(SharedStructNodeLists sharedStructNodeLists);
  8. }
  9. public interface IGroupedStructNodesEngine : IEngine
  10. {
  11. void CreateStructNodes(SharedGroupedStructNodesLists sharedStructNodeLists);
  12. }
  13. public interface IActivableNodeEngine : IEngine
  14. {
  15. void Enable(NodeWithID node);
  16. void Disable(NodeWithID node);
  17. }
  18. public interface INodeEngine : IEngine
  19. {
  20. void Add(NodeWithID node);
  21. void Remove(NodeWithID node);
  22. }
  23. }
  24. namespace Svelto.ECS.Legacy
  25. {
  26. public interface INodesEngine : INodeEngine
  27. {
  28. System.Type[] AcceptedNodes();
  29. }
  30. }
  31. namespace Svelto.ECS
  32. {
  33. public interface IEngine
  34. {}
  35. public interface IActivableNodeEngine<in TNodeType> : IActivableNodeEngine where TNodeType : INode
  36. { }
  37. public interface IQueryableNodeEngine:IEngine
  38. {
  39. IEngineNodeDB nodesDB { set; }
  40. }
  41. /// <summary>
  42. /// The engines can receive and store INodes structs
  43. /// Unboxing will happen during the Add, but the
  44. /// data will then be stored and processed as stucts
  45. /// </summary>
  46. public interface IStructNodeEngine<T> : IStructNodeEngine where T:struct, IStructNodeWithID
  47. { }
  48. /// <summary>
  49. /// same as above, but the nodes are grouped by ID
  50. /// usually the ID is the owner of the nodes of that
  51. /// group
  52. /// </summary>
  53. public interface IGroupedStructNodesEngine<T> : IGroupedStructNodesEngine where T : struct, IGroupedNode
  54. {
  55. void Add(ref T node);
  56. void Remove(ref T node);
  57. }
  58. }