コード例 #1
0
 public DelayedUpdate(Op type, int entity, IComponentPool component, int componentId)
 {
     Type        = type;
     Entity      = entity;
     Pool        = component;
     ComponentId = componentId;
 }
コード例 #2
0
        /// <summary>Sets the pool for a specific type</summary>
        /// <param name="type">The type.</param>
        /// <param name="pool">The pool.</param>
        public void SetPool(Type type, IComponentPool <ComponentPoolable> pool)
        {
            Debug.Assert(type != null, "Type must not be null.");
            Debug.Assert(pool != null, "Component pool must not be null.");

            this.pools.Add(type, pool);
        }
コード例 #3
0
ファイル: EntityFilter.cs プロジェクト: jtferson/Jtfer.Ecp
 protected void AddComponentPool(IComponentPool pool)
 {
     if (_pools.Length == _poolsCount)
     {
         Array.Resize(ref _pools, _poolsCount << 1);
     }
     _pools[_poolsCount++] = pool;
 }
コード例 #4
0
 protected void AddDelayedUpdate(DelayedUpdate.Op type, int entity, IComponentPool component, int componentId)
 {
     if (_delayedUpdatesCount == _delayedUpdates.Length)
     {
         Array.Resize(ref _delayedUpdates, _delayedUpdatesCount << 1);
     }
     _delayedUpdates[_delayedUpdatesCount++] = new DelayedUpdate(type, entity, component, componentId);
 }
コード例 #5
0
        /// <summary>Entities the manager removed component event.</summary>
        /// <param name="entity">The entity.</param>
        /// <param name="component">The component.</param>
        private void EntityManagerRemovedComponentEvent(Entity entity, IComponent component)
        {
            ComponentPoolable componentPoolable = component as ComponentPoolable;

            if (componentPoolable != null)
            {
                if (componentPoolable.PoolId < 0)
                {
                    return;
                }

                IComponentPool <ComponentPoolable> pool = this.entityWorld.GetPool(component.GetType());
                if (pool != null)
                {
                    pool.ReturnObject(componentPoolable);
                }
            }
        }
コード例 #6
0
 public PoolDecorator(IComponentPool <T> componentPool, EntityManager entityManager, ISystem system)
 {
     this.wrappedPool   = componentPool;
     this.entityManager = entityManager;
     this.system        = system;
 }
コード例 #7
0
 void IComponentPoolElement.OnRepool(IComponentPool pool)
 {
     OnRepool(pool as T);
 }
コード例 #8
0
 public ReadOnlyStorage(IComponentPool <T> pool) => _pool = pool;
コード例 #9
0
 public static void Initialize(IComponentPool pool)
 {
     Instance = pool;
 }
コード例 #10
0
 public static void Initialize(IComponentIndex index)
 {
     Instance = new ComponentPool(index);
 }
コード例 #11
0
ファイル: MutableStorage.cs プロジェクト: Golle/Titan
 public MutableStorage(IComponentPool <T> pool) => _pool = pool;