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.

16 lines
530B

  1. using Svelto.DataStructures;
  2. using Svelto.ECS.Native;
  3. namespace Svelto.ECS
  4. {
  5. public static class EntitiesDBFiltersExtension
  6. {
  7. public static bool AddEntityToFilter<N>(this EntitiesDB.LegacyFilters legacyFilters, int filtersID, EGID egid, N mapper) where N : IEGIDMultiMapper
  8. {
  9. ref var filter =
  10. ref legacyFilters.CreateOrGetFilterForGroup(filtersID, egid.groupID, new RefWrapperType(mapper.entityType));
  11. return filter.Add(egid.entityID, mapper);
  12. }
  13. }
  14. }