Mirror of Svelto.ECS because we're a fan of it
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
771B

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