Example #1
0
        public static FasterDictionary <RefWrapperType, ITypeSafeDictionary> BuildGroupedEntities
            (EGID egid, EnginesRoot.DoubleBufferedEntitiesToAdd groupEntitiesToAdd
            , IComponentBuilder[] componentsToBuild, IEnumerable <object> implementors, Type implementorType)
        {
            var group = FetchEntityGroup(egid.groupID, groupEntitiesToAdd);

            BuildEntitiesAndAddToGroup(egid, group, componentsToBuild, implementors, implementorType);

            return(group);
        }
        internal static Dictionary <Type, ITypeSafeDictionary> BuildGroupedEntities(EGID egid,
                                                                                    EnginesRoot.DoubleBufferedEntitiesToAdd groupEntitiesToAdd, IEntityBuilder[] entitiesToBuild,
                                                                                    object[] implementors)
        {
            var @group = FetchEntityGroup(egid.groupID, groupEntitiesToAdd);

            BuildEntitiesAndAddToGroup(egid, group, entitiesToBuild, implementors);

            return(group);
        }
Example #3
0
        static FasterDictionary <RefWrapperType, ITypeSafeDictionary> FetchEntityGroup
            (ExclusiveGroupStruct groupID, EnginesRoot.DoubleBufferedEntitiesToAdd groupEntityComponentsByType)
        {
            var group = groupEntityComponentsByType.current.GetOrCreate(
                groupID, () => new FasterDictionary <RefWrapperType, ITypeSafeDictionary>());

            //track the number of entities created so far in the group.
            groupEntityComponentsByType.IncrementEntityCount(groupID);

            return(group);
        }
Example #4
0
        static FasterDictionary <RefWrapperType, ITypeSafeDictionary> FetchEntityGroup
            (ExclusiveGroupStruct groupID, EnginesRoot.DoubleBufferedEntitiesToAdd groupEntityComponentsByType)
        {
            if (groupEntityComponentsByType.current.TryGetValue((uint)groupID, out var group) == false)
            {
                group = new FasterDictionary <RefWrapperType, ITypeSafeDictionary>();

                groupEntityComponentsByType.current.Add((uint)groupID, group);
            }

            //track the number of entities created so far in the group.
            groupEntityComponentsByType.IncrementEntityCount(groupID);

            return(group);
        }
        static Dictionary <Type, ITypeSafeDictionary> FetchEntityGroup(uint groupID,
                                                                       EnginesRoot.DoubleBufferedEntitiesToAdd groupEntityViewsByType)
        {
            if (groupEntityViewsByType.current.TryGetValue(groupID, out Dictionary <Type, ITypeSafeDictionary> @group) ==
                false)
            {
                @group = new Dictionary <Type, ITypeSafeDictionary>();

                groupEntityViewsByType.current.Add(groupID, @group);
            }

            groupEntityViewsByType.entitiesCreatedPerGroup.TryGetValue(groupID, out var value);
            groupEntityViewsByType.entitiesCreatedPerGroup[groupID] = value + 1;

            return(@group);
        }
Example #6
0
        public static FasterDictionary <RefWrapperType, ITypeSafeDictionary> BuildGroupedEntities
            (EGID egid, EnginesRoot.DoubleBufferedEntitiesToAdd groupEntitiesToAdd, IComponentBuilder[] componentsToBuild
            , IEnumerable <object> implementors
#if DEBUG && !PROFILE_SVELTO
            , System.Type descriptorType
#endif
            )
        {
            var group = groupEntitiesToAdd.currentComponentsToAddPerGroup.GetOrAdd(
                egid.groupID, () => new FasterDictionary <RefWrapperType, ITypeSafeDictionary>());

            //track the number of entities created so far in the group.
            groupEntitiesToAdd.IncrementEntityCount(egid.groupID);

            BuildEntitiesAndAddToGroup(egid, group, componentsToBuild, implementors
#if DEBUG && !PROFILE_SVELTO
                                       , descriptorType
#endif
                                       );

            return(group);
        }
        static FasterDictionary <RefWrapper <Type>, ITypeSafeDictionary> FetchEntityGroup(uint groupID,
                                                                                          EnginesRoot.DoubleBufferedEntitiesToAdd groupEntityViewsByType)
        {
            if (groupEntityViewsByType.current.TryGetValue(groupID, out var group) == false)
            {
                group = new FasterDictionary <RefWrapper <Type>, ITypeSafeDictionary>();

                groupEntityViewsByType.current.Add(groupID, group);
            }

            if (groupEntityViewsByType.currentEntitiesCreatedPerGroup.TryGetValue(groupID, out var value) == false)
            {
                groupEntityViewsByType.currentEntitiesCreatedPerGroup[groupID] = 0;
            }
            else
            {
                groupEntityViewsByType.currentEntitiesCreatedPerGroup[groupID] = value + 1;
            }

            return(group);
        }