private void RemoveNotConnectedBlocks() { IDictionary <BlockPosition, ILiveBlock> blocks = new Dictionary <BlockPosition, ILiveBlock>(_blocks); StructureUtilities.RemoveConnected(blocks[_mainframePosition], blocks); foreach (RealLiveBlock real in blocks.Values.OfType <RealLiveBlock>()) { Health -= real.Health; RemoveBlock(real); } }
public IDictionary <BlockPosition, IPlacedBlock> GetNotConnectedBlocks() { if (_mainframePosition == null) { return(null); } IDictionary <BlockPosition, IPlacedBlock> blocks = new Dictionary <BlockPosition, IPlacedBlock>(_blocks); StructureUtilities.RemoveConnected(blocks[_mainframePosition], blocks); return(blocks); }