private void AddChunk(int x, int y, Chunk chunk) { if (chunks[y] == null) { IntIndexArray <Chunk> row = new IntIndexArray <Chunk>(); row[x] = chunk; chunks[y] = row; } else { chunks[y][x] = chunk; } }
private Chunk GetChunk(int x, int y) { IntIndexArray <Chunk> row = chunks[y]; if (row == null) { return(null); } else { return(row[x]); } }