/// <summary> /// Gets an internal Chunk reference from cache or queries the container for it. /// </summary> /// <returns>The ChunkRef's underlying Chunk.</returns> private IChunk GetChunk() { if (_chunk == null) { _chunk = _container.GetChunk(_cx, _cz); if (_chunk != null) { _blocks = _chunk.Blocks; _entities = _chunk.Entities; // Set callback functions in the underlying block collection _blocks.ResolveNeighbor += ResolveNeighborHandler; _blocks.TranslateCoordinates += TranslateCoordinatesHandler; } } return _chunk; }
internal AlphaBlockRef(AlphaBlockCollection collection, int index) { _collection = collection; _index = index; }