diff options
| author | mat <github@matdoes.dev> | 2022-06-17 23:55:11 -0500 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2022-06-17 23:55:11 -0500 |
| commit | 614b21129804930159f041ce3f51202bc3e1c0b6 (patch) | |
| tree | 9c78d1f1bb13de5ae91d2ca2092da28c1b8ae6ef /azalea-entity/src | |
| parent | f993e79a7e6acc7aadd1e6cf9462d7a3e2c3ac3e (diff) | |
| download | azalea-drasl-614b21129804930159f041ce3f51202bc3e1c0b6.tar.xz | |
EntityStorage
Diffstat (limited to 'azalea-entity/src')
| -rw-r--r-- | azalea-entity/src/lib.rs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/azalea-entity/src/lib.rs b/azalea-entity/src/lib.rs index 506f5780..0e0178b5 100644 --- a/azalea-entity/src/lib.rs +++ b/azalea-entity/src/lib.rs @@ -4,7 +4,18 @@ use azalea_core::EntityPos; pub struct Entity { /// The incrementing numerical id of the entity. pub id: u32, - pub pos: EntityPos, + pos: EntityPos, +} + +impl Entity { + pub fn pos(&self) -> &EntityPos { + &self.pos + } + + pub fn set_pos(&mut self, pos: EntityPos) { + // TODO: check if it moved to another chunk + self.pos = pos; + } } // #[cfg(test)] |
