private void AddVoxelMapsInRange() { MySimpleProfiler.Begin("AddVoxelMapsInRange"); foreach (var voxelMap in m_inRangeCache) { if (!DepositGroupsByEntity.ContainsKey(voxelMap.GetTopMostParent() as MyVoxelBase)) //GK: Get only topmost in order to ignore MyVoxelPhysics { DepositGroupsByEntity.Add(voxelMap, new MyOreDepositGroup(voxelMap)); } } m_inRangeCache.Clear(); MySimpleProfiler.End(); }
private void RemoveVoxelMapsOutOfRange() { MySimpleProfiler.Begin("RemoveVoxelMapsOutOfRange"); foreach (var voxelMap in DepositGroupsByEntity.Keys) { if (!m_inRangeCache.Contains(voxelMap.GetTopMostParent() as MyVoxelBase)) //GK: Get only topmost in order to ignore MyVoxelPhysics { m_notInRangeCache.Add(voxelMap); } } foreach (var notInRange in m_notInRangeCache) { DepositGroupsByEntity.Remove(notInRange); } m_notInRangeCache.Clear(); MySimpleProfiler.End(); }