/// <inheritdoc/> public ChunkRef CreateChunk(int cx, int cz) { DeleteChunk(cx, cz); AlphaChunk c = AlphaChunk.Create(cx, cz); c.Save(GetChunkOutStream(cx, cz)); ChunkRef cr = ChunkRef.Create(this, cx, cz); ChunkKey k = new ChunkKey(cx, cz); _cache[k] = cr; return(cr); }
public AlphaBlockManager(IChunkManager cm) : base(cm) { IChunk c = AlphaChunk.Create(0, 0); chunkXDim = c.Blocks.XDim; chunkYDim = c.Blocks.YDim; chunkZDim = c.Blocks.ZDim; chunkXMask = chunkXDim - 1; chunkYMask = chunkYDim - 1; chunkZMask = chunkZDim - 1; chunkXLog = Log2(chunkXDim); chunkYLog = Log2(chunkYDim); chunkZLog = Log2(chunkZDim); }
/// <inheritdoc/> public ChunkRef CreateChunk(int cx, int cz) { DeleteChunk(cx, cz); AlphaChunk chunk = AlphaChunk.Create(cx, cz); using (Stream chunkOutStream = GetChunkOutStream(cx, cz)) { chunk.Save(chunkOutStream); } ChunkRef cr = ChunkRef.Create(this, cx, cz); ChunkKey k = new ChunkKey(cx, cz); _cache[k] = cr; return(cr); }
protected override IChunk CreateChunkCore(int cx, int cz) { return(AlphaChunk.Create(cx, cz)); }