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.

19 lines
738B

  1. using Svelto.ECS.Native;
  2. namespace Svelto.ECS
  3. {
  4. public static class FilterGroupExtensions
  5. {
  6. public static bool Add<N>(this LegacyFilterGroup legacyFilter, uint entityID, N mapper) where N : IEGIDMultiMapper
  7. {
  8. #if DEBUG && !PROFILE_SVELTO
  9. if (mapper.Exists(legacyFilter._exclusiveGroupStruct, entityID) == false)
  10. throw new ECSException(
  11. $"trying adding an entity {entityID} to filter {mapper.entityType} - {legacyFilter._ID} with group {legacyFilter._exclusiveGroupStruct}, but entity is not found! ");
  12. #endif
  13. return legacyFilter.InternalAdd(entityID, mapper.GetIndex(legacyFilter._exclusiveGroupStruct, entityID));
  14. }
  15. }
  16. }