Struct all_is_cubes::block::BlockAttributes
source · pub struct BlockAttributes {
pub display_name: ArcStr,
pub selectable: bool,
pub rotation_rule: RotationPlacementRule,
pub tick_action: Option<TickAction>,
pub activation_action: Option<Operation>,
pub animation_hint: AnimationHint,
}Expand description
Collection of miscellaneous attribute data for blocks that doesn’t come in variants.
BlockAttributes::default() will produce a reasonable set of defaults for “ordinary”
blocks.
Fields§
§display_name: ArcStrThe name that should be displayed to players.
The default value is the empty string. The empty string should be considered a reasonable choice for solid-color blocks with no special features.
selectable: boolWhether players’ cursors target it or pass through it.
The default value is true.
rotation_rule: RotationPlacementRuleRule about how this block should be rotated, or not, when placed in a Space by
some agent not otherwise specifying rotation.
The default value is RotationPlacementRule::Never.
tick_action: Option<TickAction>Something this block does when time passes.
activation_action: Option<Operation>Something this block does when activated with Activate.
animation_hint: AnimationHintAdvice to the renderer about how to expect this block to change, and hence what rendering strategy to use.
Note: This is automatically augmented for Primitive::Recur blocks if they
contain voxels with animation hints themselves.
Implementations§
source§impl BlockAttributes
impl BlockAttributes
sourcepub const fn default() -> BlockAttributes
pub const fn default() -> BlockAttributes
Block attributes suitable as default values for in-game use.
This function differs from the Default::default trait implementation only
in that it is a const fn.
Trait Implementations§
source§impl<'a> Arbitrary<'a> for BlockAttributes
impl<'a> Arbitrary<'a> for BlockAttributes
source§fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
Self from the given unstructured data. Read moresource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Unstructured this type
needs to construct itself. Read moresource§fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
Self from the entirety of the given
unstructured data. Read moresource§impl Clone for BlockAttributes
impl Clone for BlockAttributes
source§fn clone(&self) -> BlockAttributes
fn clone(&self) -> BlockAttributes
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for BlockAttributes
impl Debug for BlockAttributes
source§impl Default for BlockAttributes
impl Default for BlockAttributes
source§fn default() -> BlockAttributes
fn default() -> BlockAttributes
Block attributes suitable as default values for in-game use.
source§impl Hash for BlockAttributes
impl Hash for BlockAttributes
source§impl PartialEq for BlockAttributes
impl PartialEq for BlockAttributes
source§fn eq(&self, other: &BlockAttributes) -> bool
fn eq(&self, other: &BlockAttributes) -> bool
self and other values to be equal, and is used
by ==.source§impl VisitHandles for BlockAttributes
impl VisitHandles for BlockAttributes
source§fn visit_handles(&self, visitor: &mut dyn HandleVisitor)
fn visit_handles(&self, visitor: &mut dyn HandleVisitor)
impl Eq for BlockAttributes
impl StructuralPartialEq for BlockAttributes
Auto Trait Implementations§
impl Freeze for BlockAttributes
impl RefUnwindSafe for BlockAttributes
impl Send for BlockAttributes
impl Sync for BlockAttributes
impl Unpin for BlockAttributes
impl UnwindSafe for BlockAttributes
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> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
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)
clone_to_uninit)source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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 more