Example #1
0
 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];
 }
Example #2
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));
         }
     }
 }
Example #3
0
    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]);
    }