Beispiel #1
0
 public void Dispose()
 {
     _pool             = null;
     _current          = 0;
     _next             = 0;
     _iteratingVersion = 0;
 }
Beispiel #2
0
 public Enumerator(IndexPool pool)
 {
     _pool             = pool;
     _current          = -1;
     _next             = pool.firstUsed;
     _iteratingVersion = pool.Version;
 }
Beispiel #3
0
        public override void Destroy()
        {
            base.Destroy();

            _entityPool.ReleaseAll();
            _entityPool = null;

            entities       = null;
            Instance       = null;
            componentFlags = null;

            _components = null;
        }
Beispiel #4
0
        public override void Initialize()
        {
            base.Initialize();

            Assert.Debug(Instance == null, "entity system has already been initialized");

            Instance    = this;
            _entityPool = new IndexPool(_capacity, TypeName + typeof(TEntity).Name);

            entities        = new Entity <TEntity> [_capacity];
            componentFlags  = new ComponentFlags[_capacity];
            _components     = new object[_capacity];
            _componentCount = 0;
        }