#include "Generator.hpp" namespace MC::World { Chunk Generator::generate(int64_t chunk_x, int64_t chunk_y) { Chunk chunk(chunk_x, chunk_y); for (int y = 0; y < CHUNK_HEIGHT; y++) { BlockType type = BlockType::Air; if (y < CHUNK_HEIGHT / 2) { type = BlockType::Dirt; } else if (y == CHUNK_HEIGHT / 2) { type = BlockType::Grass; } for (int x = 0; x < CHUNK_WIDTH; x++) { for (int z = 0; z < CHUNK_WIDTH; z++) { chunk.set(x, y, z, type); } } } return chunk; } }