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.

38 lines
1.3KB

  1. using System.Runtime.CompilerServices;
  2. using Svelto.ECS.DataStructures;
  3. namespace Svelto.ECS
  4. {
  5. public readonly struct LegacyFilteredIndices
  6. {
  7. public LegacyFilteredIndices(NativeDynamicArrayCast<uint> denseListOfIndicesToEntityComponentArray)
  8. {
  9. _denseListOfIndicesToEntityComponentArray = denseListOfIndicesToEntityComponentArray;
  10. _count = _denseListOfIndicesToEntityComponentArray.count;
  11. }
  12. public int count
  13. {
  14. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  15. get { return _count; }
  16. }
  17. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  18. public uint Get(uint index) => _denseListOfIndicesToEntityComponentArray[index];
  19. public uint this[uint index]
  20. {
  21. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  22. get => _denseListOfIndicesToEntityComponentArray[index];
  23. }
  24. public uint this[int index]
  25. {
  26. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  27. get => _denseListOfIndicesToEntityComponentArray[index];
  28. }
  29. readonly NativeDynamicArrayCast<uint> _denseListOfIndicesToEntityComponentArray;
  30. readonly int _count;
  31. }
  32. }