コード例 #1
0
        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);
        }
コード例 #2
0
 internal NativeEntityFilterCollection(NativeEGIDMultiMapper <T> mmap)
 {
     _mmap            = mmap;
     _filtersPerGroup = new SharedSveltoDictionaryNative <ExclusiveGroupStruct, GroupFilters>();
 }
コード例 #3
0
 public bool Add <T>(EGID egid, NativeEGIDMultiMapper <T> mmap) where T : unmanaged, IBaseEntityComponent
 {
     return(Add(egid, mmap.GetIndex(egid)));
 }