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); }
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); }
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))); }