Example #1
0
        public static NativeEGIDMapper <T> QueryNativeMappedEntities <T>(this EntitiesDB entitiesDb, ExclusiveGroupStruct groupStructId)
            where T : unmanaged, IEntityComponent
        {
            if (entitiesDb.SafeQueryEntityDictionary <T>(groupStructId, out var typeSafeDictionary) == false)
            {
                throw new EntityGroupNotFoundException(typeof(T), groupStructId.ToName());
            }

            return((typeSafeDictionary as TypeSafeDictionary <T>).ToNativeEGIDMapper(groupStructId));
        }
Example #2
0
        FasterDictionary <RefWrapperType, ITypeSafeDictionary> GetDBGroup(ExclusiveGroupStruct fromIdGroupId)
        {
            if (_groupEntityComponentsDB.TryGetValue(fromIdGroupId,
                                                     out FasterDictionary <RefWrapperType, ITypeSafeDictionary> fromGroup) == false)
            {
                throw new ECSException("Group doesn't exist: ".FastConcat(fromIdGroupId.ToName()));
            }

            return(fromGroup);
        }
Example #3
0
            public ref FilterGroup GetFilterForGroup <T>(int filterId, ExclusiveGroupStruct groupID)
                where T : struct, IEntityComponent
            {
#if DEBUG && !PROFILE_SVELTO
                if (_filters.ContainsKey(TypeRefWrapper <T> .wrapper) == false)
                {
                    throw new ECSException(
                              $"trying to fetch not existing filters, type {typeof(T)}");
                }
                if (_filters[TypeRefWrapper <T> .wrapper].ContainsKey(groupID) == false)
                {
                    throw new ECSException(
                              $"trying to fetch not existing filters, type {typeof(T)} group {groupID.ToName()}");
                }
#endif
                return(ref _filters[TypeRefWrapper <T> .wrapper][groupID].GetFilter(filterId));
Example #4
0
        public override string ToString()
        {
            var value = groupID.ToName();

            return("id ".FastConcat(entityID).FastConcat(" group ").FastConcat(value));
        }
Example #5
0
 public override string ToString()
 {
     return("id ".FastConcat(entityID).FastConcat(" group ").FastConcat(groupID.ToName()));
 }
Example #6
0
            public ref LegacyGroupFilters GetFiltersForGroup <T>(ExclusiveGroupStruct groupID)
                where T : struct, IBaseEntityComponent
            {
#if DEBUG && !PROFILE_SVELTO
                if (_filtersLegacy.ContainsKey(TypeRefWrapper <T> .wrapper) == false)
                {
                    throw new ECSException($"trying to fetch not existing filters, type {typeof(T)}");
                }
                if (_filtersLegacy[TypeRefWrapper <T> .wrapper].ContainsKey(groupID) == false)
                {
                    throw new ECSException(
                              $"trying to fetch not existing filters, type {typeof(T)} group {groupID.ToName()}");
                }
#endif

                return(ref _filtersLegacy[TypeRefWrapper <T> .wrapper].GetValueByRef(groupID));
            }