pub struct Chunk {
pub path: String,
pub ground: Vec<Grid>,
pub heights: Vec<i32>,
pub zones: Grid,
pub objects: Vec<Object>,
}Expand description
One chunk of one layer.
Fields§
§path: StringSource path, relative to the root.
ground: Vec<Grid>One grid per profile ground layer, in profile order.
heights: Vec<i32>chunk_size² tile heights, row-major.
zones: GridZone per tile; empty cells take the plane’s default zone.
objects: Vec<Object>Implementations§
Source§impl Chunk
impl Chunk
Sourcepub fn object(&self, path: &[usize]) -> Option<&Object>
pub fn object(&self, path: &[usize]) -> Option<&Object>
The object at path: an index into objects, then one into the
inventory of each object down to it, as in ObjectLocation::path.
Sourcepub fn depth_first(&self) -> DepthFirst<'_> ⓘ
pub fn depth_first(&self) -> DepthFirst<'_> ⓘ
Every object of the chunk, inventory entries included, in
depth-first order: each object comes before its inventory entries,
and those before the object after it. An object’s position in this
order is its index in the chunk (docs/spec/FORMAT.md section 7).
Trait Implementations§
impl StructuralPartialEq for Chunk
Auto Trait Implementations§
impl Forget for Chunk
impl Freeze for Chunk
impl Move for Chunk
impl RefUnwindSafe for Chunk
impl Send for Chunk
impl Sync for Chunk
impl Unpin for Chunk
impl UnsafeUnpin for Chunk
impl UnwindSafe for Chunk
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more