using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace MinecraftClient.Mapping { /// /// Represent a column of chunks of terrain in a Minecraft world /// public class ChunkColumn { public const int ColumnSize = 16; /// /// Blocks contained into the chunk /// private readonly Chunk[] chunks = new Chunk[ColumnSize]; /// /// Get or set the specified chunk column /// /// ChunkColumn X /// ChunkColumn Y /// chunk at the given location public Chunk this[int chunkY] { get { return chunks[chunkY]; } set { chunks[chunkY] = value; } } /// /// Get chunk at the specified location /// /// Location, a modulo will be applied /// The chunk, or null if not loaded public Chunk GetChunk(Location location) { try { return this[location.ChunkY]; } catch (IndexOutOfRangeException) { return null; } } } }