2023-01-22 17:16:58 -06:00
|
|
|
use glam::IVec3;
|
|
|
|
use super::{
|
|
|
|
chunk::{BlockData, CHUNK_SIZE},
|
|
|
|
block::Block
|
|
|
|
};
|
|
|
|
|
2023-01-25 20:39:39 -06:00
|
|
|
pub fn generate_world(position: IVec3, _seed: u32) -> BlockData {
|
2023-01-22 17:16:58 -06:00
|
|
|
let mut blocks = Box::new([[[Block::Air; CHUNK_SIZE]; CHUNK_SIZE]; CHUNK_SIZE]);
|
2023-01-25 20:54:41 -06:00
|
|
|
//TODO actual world generation
|
2023-01-25 20:50:38 -06:00
|
|
|
if position.y == -1 {
|
2023-01-25 20:39:39 -06:00
|
|
|
for x in 0..CHUNK_SIZE {
|
|
|
|
for z in 0..CHUNK_SIZE {
|
2023-01-25 20:50:38 -06:00
|
|
|
blocks[x][0][z] = Block::Grass;
|
2023-01-25 20:39:39 -06:00
|
|
|
}
|
|
|
|
}
|
2023-01-25 20:58:05 -06:00
|
|
|
} else if position.y < -1 {
|
|
|
|
for x in 0..CHUNK_SIZE {
|
|
|
|
for y in 0..CHUNK_SIZE {
|
|
|
|
for z in 0..CHUNK_SIZE {
|
|
|
|
blocks[x][y][z] = Block::Dirt;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-01-25 20:39:39 -06:00
|
|
|
}
|
2023-01-22 17:16:58 -06:00
|
|
|
blocks
|
|
|
|
}
|