refactor: biome build (#5)

* refactor: rename Biome to BiomeType

* feat: add biome builder
This commit is contained in:
zhenyan121
2026-05-02 13:40:46 +08:00
committed by GitHub
parent a63dfa7f47
commit a02bfad639
20 changed files with 563 additions and 164 deletions

View File

@@ -0,0 +1,18 @@
#include "Cubed/gameplay/builders/biome_builder.hpp"
#include "Cubed/gameplay/chunk.hpp"
#include "Cubed/gameplay/chunk_generator.hpp"
namespace Cubed {
void BiomeBuilder::build_bottom() {
ChunkGenerator& chunk_generator = get_chunk_generator();
Chunk& chunk = chunk_generator.chunk();
auto& m_blocks = chunk.blocks();
for (int x = 0; x < CHUCK_SIZE; x++) {
for (int y = 0; y < 5; y++) {
for (int z = 0; z < CHUCK_SIZE; z++) {
m_blocks[Chunk::get_index(x, y, z)] = 3;
}
}
}
}
} // namespace Cubed