예제 #1
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);
        }
예제 #2
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);
        }
예제 #3
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);
        }