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.

39 lines
1.3KB

  1. using System.Runtime.CompilerServices;
  2. using Svelto.DataStructures;
  3. namespace Svelto.ECS
  4. {
  5. //TODO there is an overlap between these methods and Group Compound Includes
  6. public static class ExclusiveGroupExtensions
  7. {
  8. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  9. public static bool FoundIn(this in ExclusiveGroupStruct group, ExclusiveGroupStruct[] groups)
  10. {
  11. for (int i = 0; i < groups.Length; ++i)
  12. if (groups[i] == group)
  13. return true;
  14. return false;
  15. }
  16. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  17. public static bool FoundIn(this in ExclusiveGroupStruct group, FasterList<ExclusiveGroupStruct> groups)
  18. {
  19. for (int i = 0; i < groups.count; ++i)
  20. if (groups[i] == group)
  21. return true;
  22. return false;
  23. }
  24. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  25. public static bool FoundIn(this in ExclusiveGroupStruct group, LocalFasterReadOnlyList<ExclusiveGroupStruct> groups)
  26. {
  27. for (int i = 0; i < groups.count; ++i)
  28. if (groups[i] == group)
  29. return true;
  30. return false;
  31. }
  32. }
  33. }