mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-07-09 09:09:07 +02:00
world: add section iterator
An (empty for now) trait is introduced to abstract over the two section types.
This commit is contained in:
parent
2d782f25b1
commit
c130f3cdae
2 changed files with 124 additions and 2 deletions
|
@ -15,6 +15,8 @@ fn palette_bits(len: usize, min: u8, max: u8) -> Option<u8> {
|
|||
Some(bits)
|
||||
}
|
||||
|
||||
pub trait Section {}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct PaletteSectionBiomes<'a> {
|
||||
biomes: Option<&'a fastnbt::LongArray>,
|
||||
|
@ -81,6 +83,8 @@ impl<'a> PaletteSection<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> Section for PaletteSection<'a> {}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct OldSection<'a> {
|
||||
blocks: &'a fastnbt::ByteArray,
|
||||
|
@ -93,3 +97,5 @@ impl<'a> OldSection<'a> {
|
|||
Ok(Self { blocks, data })
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Section for OldSection<'a> {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue