aboutsummaryrefslogtreecommitdiff
path: root/azalea-world/src/lib.rs
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-06-25 14:24:56 -0500
committermat <github@matdoes.dev>2022-06-25 14:24:56 -0500
commit77980f0018eca3a192994021b76ad5d05bff88ea (patch)
tree8a7ad1337f21542f1dbe098057b1e4e156df976c /azalea-world/src/lib.rs
parentcd9a05e5a62190b3d4a2a733bf637d6324aec5fd (diff)
downloadazalea-drasl-77980f0018eca3a192994021b76ad5d05bff88ea.tar.xz
rename World to dimension
A world is a collection of dimensions
Diffstat (limited to 'azalea-world/src/lib.rs')
-rw-r--r--azalea-world/src/lib.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/azalea-world/src/lib.rs b/azalea-world/src/lib.rs
index 3afa4fee..7822dcc4 100644
--- a/azalea-world/src/lib.rs
+++ b/azalea-world/src/lib.rs
@@ -27,15 +27,16 @@ mod tests {
}
}
+/// A dimension is a collection of chunks and entities.
#[derive(Debug)]
-pub struct World {
+pub struct Dimension {
chunk_storage: ChunkStorage,
entity_storage: EntityStorage,
}
-impl World {
+impl Dimension {
pub fn new(chunk_radius: u32, height: u32, min_y: i32) -> Self {
- World {
+ Dimension {
chunk_storage: ChunkStorage::new(chunk_radius, height, min_y),
entity_storage: EntityStorage::new(),
}
@@ -135,14 +136,14 @@ impl World {
}
}
-impl Index<&ChunkPos> for World {
+impl Index<&ChunkPos> for Dimension {
type Output = Option<Arc<Mutex<Chunk>>>;
fn index(&self, pos: &ChunkPos) -> &Self::Output {
&self.chunk_storage[pos]
}
}
-impl IndexMut<&ChunkPos> for World {
+impl IndexMut<&ChunkPos> for Dimension {
fn index_mut<'a>(&'a mut self, pos: &ChunkPos) -> &'a mut Self::Output {
&mut self.chunk_storage[pos]
}