Esempio n. 1
0
        private bool TryGetMmrComponent(int entityId, out MmrComponent com)
        {
            if (_mmrEntityMap.TryGet(entityId, out int componentIndex) && componentIndex != Container.EMPTY_ID)
            {
                if (_mmrComponents.ContainIndex(componentIndex))
                {
                    com = _mmrComponents.Get(componentIndex);
                    return(true);
                }
            }

            com = null;
            return(false);
        }
Esempio n. 2
0
        private MmrComponent GetMmrComponentFromPool()
        {
            MmrComponent result;

            if (_mmrPool.Count > 0)
            {
                result = _mmrPool.Dequeue();
            }
            else
            {
                result = new MmrComponent();
            }

            result.Reset();
            return(result);
        }
Esempio n. 3
0
 public void ReleaseMmrComponent(MmrComponent com)
 {
     com.Reset();
     _mmrPool.Enqueue(com);
 }