pub struct LightSectionRange {
min_section_y: i32,
section_count: i32,
}Expand description
Inclusive/exclusive vertical range of light sections for a level.
Vanilla’s LevelLightEngine exposes this as getMinLightSection(),
getMaxLightSection(), and getLightSectionCount(). The range is padded by
one section below and one section above the real chunk sections.
Fields§
§min_section_y: i32§section_count: i32Implementations§
Source§impl LightSectionRange
impl LightSectionRange
Sourcepub const fn from_world_height(
min_y: i32,
height: i32,
) -> Result<Self, LightSectionRangeError>
pub const fn from_world_height( min_y: i32, height: i32, ) -> Result<Self, LightSectionRangeError>
Creates the vanilla padded light-section range for a world height.
Sourcepub const fn min_section_y(self) -> i32
pub const fn min_section_y(self) -> i32
Returns the first light section Y coordinate.
Sourcepub const fn max_section_y_exclusive(self) -> i32
pub const fn max_section_y_exclusive(self) -> i32
Returns the section Y coordinate one past the last light section.
Sourcepub const fn section_count(self) -> usize
pub const fn section_count(self) -> usize
Returns the number of light sections in this range.
Sourcepub const fn min_chunk_section_y(self) -> i32
pub const fn min_chunk_section_y(self) -> i32
Returns the first real chunk section Y coordinate.
Sourcepub const fn max_chunk_section_y_exclusive(self) -> i32
pub const fn max_chunk_section_y_exclusive(self) -> i32
Returns the real chunk section Y coordinate one past the last section.
Sourcepub const fn chunk_section_count(self) -> usize
pub const fn chunk_section_count(self) -> usize
Returns the number of real chunk sections inside this light range.
Sourcepub const fn section_y(self, section_index: usize) -> Option<i32>
pub const fn section_y(self, section_index: usize) -> Option<i32>
Converts a packet light-section index to a section Y coordinate.
Sourcepub const fn section_index(self, section_y: i32) -> Option<usize>
pub const fn section_index(self, section_y: i32) -> Option<usize>
Converts a section Y coordinate to a packet light-section index.
Sourcepub const fn chunk_section_y(self, section_index: usize) -> Option<i32>
pub const fn chunk_section_y(self, section_index: usize) -> Option<i32>
Converts a real chunk-section index to a section Y coordinate.
Sourcepub const fn chunk_section_index(self, section_y: i32) -> Option<usize>
pub const fn chunk_section_index(self, section_y: i32) -> Option<usize>
Converts a real chunk section Y coordinate to an emptiness-map index.
pub(super) fn empty_bit_set(self) -> BitSet
Trait Implementations§
Source§impl Clone for LightSectionRange
impl Clone for LightSectionRange
Source§fn clone(&self) -> LightSectionRange
fn clone(&self) -> LightSectionRange
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for LightSectionRange
Source§impl Debug for LightSectionRange
impl Debug for LightSectionRange
impl Eq for LightSectionRange
Source§impl PartialEq for LightSectionRange
impl PartialEq for LightSectionRange
impl StructuralPartialEq for LightSectionRange
Auto Trait Implementations§
impl Freeze for LightSectionRange
impl RefUnwindSafe for LightSectionRange
impl Send for LightSectionRange
impl Sync for LightSectionRange
impl Unpin for LightSectionRange
impl UnsafeUnpin for LightSectionRange
impl UnwindSafe for LightSectionRange
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
self with key and returns true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreArc<SyncMutex<>>