Enum veloren_common::terrain::block::BlockKind
source · #[repr(u8)]pub enum BlockKind {
Show 18 variants
Air = 0,
Water = 1,
Rock = 16,
WeakRock = 17,
Lava = 18,
GlowingRock = 19,
GlowingWeakRock = 20,
Grass = 32,
Snow = 33,
ArtSnow = 34,
Earth = 48,
Sand = 49,
Wood = 64,
Leaves = 65,
GlowingMushroom = 66,
Ice = 67,
ArtLeaves = 68,
Misc = 254,
}
Variants§
Air = 0
Water = 1
Rock = 16
WeakRock = 17
Lava = 18
GlowingRock = 19
GlowingWeakRock = 20
Grass = 32
Snow = 33
ArtSnow = 34
Earth = 48
Sand = 49
Wood = 64
Leaves = 65
GlowingMushroom = 66
Ice = 67
ArtLeaves = 68
Misc = 254
Implementations§
source§impl BlockKind
impl BlockKind
source§impl BlockKind
impl BlockKind
pub const fn is_air(&self) -> bool
sourcepub const fn is_fluid(&self) -> bool
pub const fn is_fluid(&self) -> bool
Determine whether the block kind is a gas or a liquid. This does not consider any sprites that may occupy the block (the definition of fluid is ‘a substance that deforms to fit containers’)
pub const fn is_liquid(&self) -> bool
pub const fn liquid_kind(&self) -> Option<LiquidKind>
sourcepub const fn is_filled(&self) -> bool
pub const fn is_filled(&self) -> bool
Determine whether the block is filled (i.e: fully solid). Right now, this is the opposite of being a fluid.
sourcepub const fn has_color(&self) -> bool
pub const fn has_color(&self) -> bool
Determine whether the block has an RGB color stored in the attribute fields.
sourcepub const fn is_terrain(&self) -> bool
pub const fn is_terrain(&self) -> bool
Determine whether the block is ‘terrain-like’. This definition is arbitrary, but includes things like rocks, soils, sands, grass, and other blocks that might be expected to the landscape. Plant matter and snow are not included.
Trait Implementations§
source§impl<'de> Deserialize<'de> for BlockKind
impl<'de> Deserialize<'de> for BlockKind
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl FromPrimitive for BlockKind
impl FromPrimitive for BlockKind
source§fn from_i64(n: i64) -> Option<Self>
fn from_i64(n: i64) -> Option<Self>
Converts an
i64
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_u64(n: u64) -> Option<Self>
fn from_u64(n: u64) -> Option<Self>
Converts an
u64
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_isize(n: isize) -> Option<Self>
fn from_isize(n: isize) -> Option<Self>
Converts an
isize
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_i8(n: i8) -> Option<Self>
fn from_i8(n: i8) -> Option<Self>
Converts an
i8
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_i16(n: i16) -> Option<Self>
fn from_i16(n: i16) -> Option<Self>
Converts an
i16
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_i32(n: i32) -> Option<Self>
fn from_i32(n: i32) -> Option<Self>
Converts an
i32
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_i128(n: i128) -> Option<Self>
fn from_i128(n: i128) -> Option<Self>
Converts an
i128
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned. Read moresource§fn from_usize(n: usize) -> Option<Self>
fn from_usize(n: usize) -> Option<Self>
Converts a
usize
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_u8(n: u8) -> Option<Self>
fn from_u8(n: u8) -> Option<Self>
Converts an
u8
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_u16(n: u16) -> Option<Self>
fn from_u16(n: u16) -> Option<Self>
Converts an
u16
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_u32(n: u32) -> Option<Self>
fn from_u32(n: u32) -> Option<Self>
Converts an
u32
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_u128(n: u128) -> Option<Self>
fn from_u128(n: u128) -> Option<Self>
Converts an
u128
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned. Read moresource§impl IntoEnumIterator for BlockKind
impl IntoEnumIterator for BlockKind
type Iterator = BlockKindIter
fn iter() -> BlockKindIter ⓘ
source§impl<Target> PackedElim for WeakHead<BlockKind, Target>
impl<Target> PackedElim for WeakHead<BlockKind, Target>
type Air = <WeakHead<Pure<Target>, Target> as SynthTyped<(), Target>>::Expr
type Water = <WeakHead<Pure<Target>, Target> as SynthTyped<(), Target>>::Expr
type Rock = <WeakHead<Pure<Target>, Target> as SynthTyped<(), Target>>::Expr
type WeakRock = <WeakHead<Pure<Target>, Target> as SynthTyped<(), Target>>::Expr
type Lava = <WeakHead<Pure<Target>, Target> as SynthTyped<(), Target>>::Expr
type GlowingRock = <WeakHead<Pure<Target>, Target> as SynthTyped<(), Target>>::Expr
type GlowingWeakRock = <WeakHead<Pure<Target>, Target> as SynthTyped<(), Target>>::Expr
type Grass = <WeakHead<Pure<Target>, Target> as SynthTyped<(), Target>>::Expr
type Snow = <WeakHead<Pure<Target>, Target> as SynthTyped<(), Target>>::Expr
type ArtSnow = <WeakHead<Pure<Target>, Target> as SynthTyped<(), Target>>::Expr
type Earth = <WeakHead<Pure<Target>, Target> as SynthTyped<(), Target>>::Expr
type Sand = <WeakHead<Pure<Target>, Target> as SynthTyped<(), Target>>::Expr
type Wood = <WeakHead<Pure<Target>, Target> as SynthTyped<(), Target>>::Expr
type Leaves = <WeakHead<Pure<Target>, Target> as SynthTyped<(), Target>>::Expr
type GlowingMushroom = <WeakHead<Pure<Target>, Target> as SynthTyped<(), Target>>::Expr
type Ice = <WeakHead<Pure<Target>, Target> as SynthTyped<(), Target>>::Expr
type ArtLeaves = <WeakHead<Pure<Target>, Target> as SynthTyped<(), Target>>::Expr
type Misc = <WeakHead<Pure<Target>, Target> as SynthTyped<(), Target>>::Expr
source§impl PartialEq for BlockKind
impl PartialEq for BlockKind
source§impl<Context, Target> SynthTyped<((BlockKind,), Context), Target> for WeakHead<BlockKind, Target>
impl<Context, Target> SynthTyped<((BlockKind,), Context), Target> for WeakHead<BlockKind, Target>
impl Copy for BlockKind
impl Eq for BlockKind
impl StructuralPartialEq for BlockKind
Auto Trait Implementations§
impl Freeze for BlockKind
impl RefUnwindSafe for BlockKind
impl Send for BlockKind
impl Sync for BlockKind
impl Unpin for BlockKind
impl UnwindSafe for BlockKind
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<C, M> ConvertSaveload<M> for C
impl<C, M> ConvertSaveload<M> for C
§type Error = Infallible
type Error = Infallible
Error may occur during serialization or deserialization of component
§fn convert_into<F>(
&self,
_: F,
) -> Result<<C as ConvertSaveload<M>>::Data, <C as ConvertSaveload<M>>::Error>
fn convert_into<F>( &self, _: F, ) -> Result<<C as ConvertSaveload<M>>::Data, <C as ConvertSaveload<M>>::Error>
Convert this data type into serializable form (
Data
) using
entity to marker mapping function§fn convert_from<F>(
data: <C as ConvertSaveload<M>>::Data,
_: F,
) -> Result<C, <C as ConvertSaveload<M>>::Error>
fn convert_from<F>( data: <C as ConvertSaveload<M>>::Data, _: F, ) -> Result<C, <C as ConvertSaveload<M>>::Error>
Convert this data from a deserializable form (
Data
) using
entity to marker mapping function§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
Checks if this value is equivalent to the given key. Read more
§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
Compare self to
key
and return 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>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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>
Converts
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>
Converts
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 more