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); }
private MmrComponent GetMmrComponentFromPool() { MmrComponent result; if (_mmrPool.Count > 0) { result = _mmrPool.Dequeue(); } else { result = new MmrComponent(); } result.Reset(); return(result); }
public void ReleaseMmrComponent(MmrComponent com) { com.Reset(); _mmrPool.Enqueue(com); }