Exemple #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);
        }
Exemple #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);
        }
Exemple #3
0
        public bool Add <T>(EGID egid, NativeEGIDMapper <T> mmap) where T : unmanaged, IBaseEntityComponent
        {
            DBC.ECS.Check.Require(mmap.groupID == egid.groupID, "not compatible NativeEgidMapper used");

            return(Add(egid, mmap.GetIndex(egid.entityID)));
        }