public static bool TryQueryNativeMappedEntities <T>(this EntitiesDB entitiesDb, LocalFasterReadOnlyList <ExclusiveGroupStruct> groups, out NativeEGIDMultiMapper <T> mapper) where T : unmanaged, IEntityComponent { var dictionary = new SveltoDictionary <ExclusiveGroupStruct, SveltoDictionary <uint, T, NativeStrategy <FasterDictionaryNode <uint> >, NativeStrategy <T> >, NativeStrategy <FasterDictionaryNode <ExclusiveGroupStruct> >, NativeStrategy <SveltoDictionary <uint, T, NativeStrategy <FasterDictionaryNode <uint> >, NativeStrategy <T> > > > (groups.count, Allocator.TempJob); foreach (var group in groups) { if (entitiesDb.SafeQueryEntityDictionary <T>(group, out var typeSafeDictionary) == true) { dictionary.Add(group, ((TypeSafeDictionary <T>)typeSafeDictionary).implUnmgd); } } mapper = new NativeEGIDMultiMapper <T>(dictionary); if (dictionary.count == 0) { return(false); } return(true); }
internal NativeEntityFilterCollection(NativeEGIDMultiMapper <T> mmap) { _mmap = mmap; _filtersPerGroup = new SharedSveltoDictionaryNative <ExclusiveGroupStruct, GroupFilters>(); }
public bool Add <T>(EGID egid, NativeEGIDMultiMapper <T> mmap) where T : unmanaged, IBaseEntityComponent { return(Add(egid, mmap.GetIndex(egid))); }