world: add section iterator

An (empty for now) trait is introduced to abstract over the two section
types.
This commit is contained in:
Matthias Schiffer 2023-02-12 16:19:41 +01:00
parent 2d782f25b1
commit c130f3cdae
Signed by: neocturne
GPG key ID: 16EF3F64CB201D9C
2 changed files with 124 additions and 2 deletions

View file

@ -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> {}