pub struct CellType(pub u8);Expand description
The type of a map cell. Types 5 to 8 block movement (the mask 0x1e0); the others can be
walked on (the mask 0xe1f). Types whose meaning is not confirmed have no name.
Tuple Fields§
§0: u8Implementations§
Source§impl CellType
impl CellType
Sourcepub const SHALLOW_WATER: CellType
pub const SHALLOW_WATER: CellType
Shallow water. It blocks movement.
Sourcepub const DEEP_WATER: CellType
pub const DEEP_WATER: CellType
Deep water. It blocks movement.
Sourcepub fn classify(height: f32, up: f32) -> CellType
pub fn classify(height: f32, up: f32) -> CellType
The natural type of a cell from the ground height and the up component of its normal:
deep water below -1.4, shallow water below -0.25, ground from -0.25 to 0.75 when the
ground is flat (up ≥ 0.9), rough ground below 2.0, and high ground above.
Original: FUN_1400a3790.
Sourcepub fn blocks_movement(self) -> bool
pub fn blocks_movement(self) -> bool
Whether walkers cannot enter a cell of this type.
Trait Implementations§
impl Copy for CellType
impl Eq for CellType
impl StructuralPartialEq for CellType
Auto Trait Implementations§
impl Freeze for CellType
impl RefUnwindSafe for CellType
impl Send for CellType
impl Sync for CellType
impl Unpin for CellType
impl UnsafeUnpin for CellType
impl UnwindSafe for CellType
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