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.

ExclusiveGroupExtensions.cs 1.2KB

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