public void addChunk(WorldChunk chunk)
 {
     if (!getBucket(WorldChunk.GetAbsoluteIndex(chunk.getX(), chunk.getZ())).elementExists(WorldChunk.GetAbsoluteIndex(chunk.getX(), chunk.getZ())))
     {
         getBucket(WorldChunk.GetAbsoluteIndex(chunk.getX(), chunk.getZ())).addElement(chunk);
     }
 }
 public bool elementExists(int abs_chunk_index)
 {
     for (int i = 0; i < elements.Count; ++i)
     {
         if (WorldChunk.GetAbsoluteIndex(elements[i].getX(), elements[i].getZ()) == abs_chunk_index)
         {
             return(true);
         }
     }
     return(false);
 }
 public void removeElement(int abs_chunk_index)
 {
     for (int i = 0; i < elements.Count; ++i)
     {
         if (WorldChunk.GetAbsoluteIndex(elements [i].getX(), elements [i].getZ()) == abs_chunk_index)
         {
             elements.RemoveAt(i);
             break;
         }
     }
 }
 public WorldChunk findElement(int abs_chunk_index)
 {
     for (int i = 0; i < elements.Count; ++i)
     {
         if (WorldChunk.GetAbsoluteIndex(elements[i].getX(), elements[i].getZ()) == abs_chunk_index)
         {
             return(elements[i]);
         }
     }
     return(null);
 }
 public void removeChunk(int chunk_x, int chunk_z)
 {
     getBucket(WorldChunk.GetAbsoluteIndex(chunk_x, chunk_z)).removeElement(WorldChunk.GetAbsoluteIndex(chunk_x, chunk_z));
 }