コード例 #1
0
        internal static NativeEGIDMapper <T> ToNativeEGIDMapper <T>(this TypeSafeDictionary <T> dic,
                                                                    ExclusiveGroupStruct groupStructId) where T : unmanaged, IEntityComponent
        {
            var mapper = new NativeEGIDMapper <T>(groupStructId, dic.implUnmgd);

            return(mapper);
        }
コード例 #2
0
        public static bool TryQueryNativeMappedEntities <T>(this EntitiesDB entitiesDb, ExclusiveGroupStruct groupStructId,
                                                            out NativeEGIDMapper <T> mapper)
            where T : unmanaged, IEntityComponent
        {
            mapper = default;
            if (entitiesDb.SafeQueryEntityDictionary <T>(groupStructId, out var typeSafeDictionary) == false ||
                typeSafeDictionary.count == 0)
            {
                return(false);
            }

            mapper = (typeSafeDictionary as TypeSafeDictionary <T>).ToNativeEGIDMapper(groupStructId);

            return(true);
        }