Example #1
0
        internal Consumer <T> GenerateConsumer <T>(string name, int capacity) where T : unmanaged, IEntityStruct
        {
            if (_streams.ContainsKey(typeof(T)) == false)
            {
                _streams[typeof(T)] = new EntityStream <T>();
            }

            return((_streams[typeof(T)] as EntityStream <T>).GenerateConsumer(name, capacity));
        }
        public Consumer <T> GenerateConsumer <T>(ExclusiveGroup @group, string name, int capacity) where T : unmanaged, IEntityStruct
        {
            if (_streams.ContainsKey(typeof(T)) == false)
            {
                _streams[typeof(T)] = new EntityStream <T>();
            }

            return((_streams[typeof(T)] as EntityStream <T>).GenerateConsumer(@group, name, capacity));
        }
Example #3
0
        public Consumer <T> GenerateConsumer <T>(ExclusiveGroupStruct group, string name, uint capacity)
            where T : unmanaged, IEntityComponent
        {
            if (_streams.ContainsKey(TypeRefWrapper <T> .wrapper) == false)
            {
                _streams[TypeRefWrapper <T> .wrapper] = new EntityStream <T>();
            }

            EntityStream <T> typeSafeStream = (EntityStream <T>)_streams[TypeRefWrapper <T> .wrapper];

            return(typeSafeStream.GenerateConsumer(group, name, capacity));
        }
Example #4
0
        internal Consumer(string name, uint capacity, EntityStream <T> stream) : this()
        {
#if DEBUG && !PROFILER
            _name = name;
#endif
            _ringBuffer = new RingBuffer <ValueTuple <T, EGID> >((int)capacity,
#if DEBUG && !PROFILER
                                                                 _name
#else
                                                                 string.Empty
#endif
                                                                 );

            _stream = stream;
        }
Example #5
0
 internal Consumer(string name, int capacity, EntityStream <T> stream)
 {
     _ringBuffer = new RingBuffer <T>(capacity);
     _name       = name;
     _stream     = stream;
 }
 internal Consumer(ExclusiveGroup @group, string name, int capacity, EntityStream <T> stream) : this(name, capacity, stream)
 {
     _group    = group;
     _hasGroup = true;
 }