2019-01-02 19:22:01 +00:00
|
|
|
pub mod biome;
|
2019-04-29 20:37:19 +00:00
|
|
|
pub mod block;
|
2019-05-17 17:44:30 +00:00
|
|
|
pub mod chonk;
|
2019-01-02 19:22:01 +00:00
|
|
|
|
2019-01-15 15:13:11 +00:00
|
|
|
// Reexports
|
2019-04-29 20:37:19 +00:00
|
|
|
pub use self::{biome::BiomeKind, block::Block};
|
2019-01-15 15:13:11 +00:00
|
|
|
|
2019-01-02 19:22:01 +00:00
|
|
|
use crate::{
|
|
|
|
vol::VolSize,
|
2019-05-17 17:44:30 +00:00
|
|
|
volumes::{chunk::Chunk, vol_map_2d::VolMap2d},
|
2019-01-02 19:22:01 +00:00
|
|
|
};
|
2019-04-29 20:37:19 +00:00
|
|
|
use serde_derive::{Deserialize, Serialize};
|
|
|
|
use vek::*;
|
2019-01-02 19:22:01 +00:00
|
|
|
|
2019-01-15 15:13:11 +00:00
|
|
|
// TerrainChunkSize
|
2019-01-02 19:22:01 +00:00
|
|
|
|
2019-04-22 00:38:29 +00:00
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
2019-01-15 15:13:11 +00:00
|
|
|
pub struct TerrainChunkSize;
|
2019-01-02 19:22:01 +00:00
|
|
|
|
2019-01-15 15:13:11 +00:00
|
|
|
impl VolSize for TerrainChunkSize {
|
2019-04-29 20:37:19 +00:00
|
|
|
const SIZE: Vec3<u32> = Vec3 {
|
|
|
|
x: 32,
|
|
|
|
y: 32,
|
|
|
|
z: 32,
|
|
|
|
};
|
2019-01-02 19:22:01 +00:00
|
|
|
}
|
|
|
|
|
2019-01-15 15:13:11 +00:00
|
|
|
// TerrainChunkMeta
|
2019-01-02 19:22:01 +00:00
|
|
|
|
2019-04-22 00:38:29 +00:00
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
2019-01-15 15:13:11 +00:00
|
|
|
pub struct TerrainChunkMeta {
|
2019-01-02 19:22:01 +00:00
|
|
|
biome: BiomeKind,
|
|
|
|
}
|
|
|
|
|
2019-01-15 15:13:11 +00:00
|
|
|
impl TerrainChunkMeta {
|
|
|
|
pub fn void() -> Self {
|
|
|
|
Self {
|
|
|
|
biome: BiomeKind::Void,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Terrain type aliases
|
2019-01-02 19:22:01 +00:00
|
|
|
|
2019-05-17 17:44:30 +00:00
|
|
|
pub type TerrainChunk = chonk::Chonk; //Chunk<Block, TerrainChunkSize, TerrainChunkMeta>;
|
|
|
|
pub type TerrainMap = VolMap2d<TerrainChunk, TerrainChunkSize>;
|