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.

SingleNodeEngine.cs 799B

7 years ago
12345678910111213141516171819202122232425262728293031
  1. using Svelto.DataStructures;
  2. using Svelto.ECS.Internal;
  3. namespace Svelto.ECS
  4. {
  5. public abstract class SingleNodeEngine<T> : INodeEngine where T:class
  6. {
  7. public void Add(ITypeSafeList nodes)
  8. {
  9. var strongTypeNodes = (FasterList<T>)nodes;
  10. for (int i = 0; i < strongTypeNodes.Count; i++)
  11. {
  12. Add(strongTypeNodes[i]); //when byref returns will be vailable, this should be passed by reference, not copy!
  13. }
  14. }
  15. public void Remove(ITypeSafeList nodes)
  16. {
  17. /*
  18. T node;
  19. nodeWrapper.GetNode(out node);
  20. Remove(node);*/
  21. }
  22. protected abstract void Add(T node);
  23. protected abstract void Remove(T node);
  24. }
  25. }