Example #1
0
        private bool TryGetWaitingComponent(int entityId, out WaitingComponent com)
        {
            if (_waitingEntityMap.TryGet(entityId, out int componentIndex) && componentIndex != Container.EMPTY_ID)
            {
                if (_waitingComponents.ContainIndex(componentIndex))
                {
                    com = _waitingComponents.Get(componentIndex);
                    return(true);
                }
            }

            com = null;
            return(false);
        }
Example #2
0
        private WaitingComponent GetWaitingComponentFromPool()
        {
            WaitingComponent result;

            if (_waitingPool.Count > 0)
            {
                result = _waitingPool.Dequeue();
            }
            else
            {
                result = new WaitingComponent();
            }

            result.Reset();
            return(result);
        }
Example #3
0
 public void ReleaseWaitingComponent(WaitingComponent com)
 {
     com.Reset();
     _waitingPool.Enqueue(com);
 }