public static byte[] GetChunk(IChunkDb db, int x, int y, int z) { List<byte[]> chunks = new List<byte[]>(db.GetChunks(new Xyz[] { new Xyz() { X = x, Y = y, Z = z } })); if (chunks.Count > 1) { throw new Exception(); } if (chunks.Count == 0) { return null; } return chunks[0]; }
public IEnumerable <byte[]> GetChunks(IEnumerable <Xyz> chunkpositions) { foreach (byte[] b in d_ChunkDb.GetChunks(chunkpositions)) { if (b == null) { yield return(null); } else { yield return(d_Compression.Decompress(b)); } } }
public static byte[] GetChunk(IChunkDb db, int x, int y, int z) { List <byte[]> chunks = new List <byte[]>(db.GetChunks(new Xyz[] { new Xyz() { X = x, Y = y, Z = z } })); if (chunks.Count > 1) { throw new Exception(); } if (chunks.Count == 0) { return(null); } return(chunks[0]); }