コード例 #1
0
ファイル: StateStorage.cs プロジェクト: cleancoindev/ecs
        public void CopyFrom(Storage <TEntity> other)
        {
            if (this.list != null)
            {
                PoolRefList <TEntity> .Recycle(ref this.list);
            }
            this.list = PoolRefList <TEntity> .Spawn(other.list.Capacity);

            this.list.CopyFrom(other.list);
        }
コード例 #2
0
ファイル: StateStorage.cs プロジェクト: mmvlad/ecs
        void IPoolableRecycle.OnRecycle()
        {
            PoolClass <ArchetypeEntities> .Recycle(ref this.archetypes);

            if (this.list != null)
            {
                PoolRefList <Entity> .Recycle(ref this.list);
            }
            this.freeze = false;
        }
コード例 #3
0
ファイル: StateStorage.cs プロジェクト: cleancoindev/ecs
 public void SetData(RefList <TEntity> data)
 {
     if (this.freeze == false && data != null && this.list != data)
     {
         if (this.list != null)
         {
             PoolRefList <TEntity> .Recycle(ref this.list);
         }
         this.list = data;
     }
 }
コード例 #4
0
ファイル: StateStorage.cs プロジェクト: mmvlad/ecs
        public void CopyFrom(Storage other)
        {
            this.archetypes.CopyFrom(other.archetypes);
            if (this.list != null)
            {
                PoolRefList <Entity> .Recycle(ref this.list);
            }
            this.list = PoolRefList <Entity> .Spawn(other.list.Capacity);

            this.list.CopyFrom(other.list);
        }
コード例 #5
0
ファイル: StateStorage.cs プロジェクト: cleancoindev/ecs
        void IPoolableRecycle.OnRecycle()
        {
            PoolRefList <TEntity> .Recycle(ref this.list);

            this.freeze = false;
        }
コード例 #6
0
ファイル: StateStorage.cs プロジェクト: cleancoindev/ecs
 public void Initialize(int capacity)
 {
     this.list = PoolRefList <TEntity> .Spawn(capacity);
 }
コード例 #7
0
ファイル: StateStorage.cs プロジェクト: mmvlad/ecs
        public void Initialize(int capacity)
        {
            this.list = PoolRefList <Entity> .Spawn(capacity);

            this.archetypes = PoolClass <ArchetypeEntities> .Spawn();
        }