#[non_exhaustive]pub enum Fluff {
Beep,
Happened,
BlockFault(BlockFault),
PlaceBlockGeneric,
#[non_exhaustive] BlockImpact {
velocity: PositiveSign<f32>,
},
}Expand description
Momentary decorative and informative effects produced by the game world, such as sound and particles.
Each Fluff value represents the beginning of such an effect. It does not specify
anything about the exact duration; the intent is that they should all be negligibly
short.
Some fluff refers to events happening in a Space. In that case, the position and extent
is communicated separately via SpaceFluff.
Currently, all Fluff is an item from a fixed list. In the future, it will be able
to refer to audio and visual assets defined in a Universe.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Beep
A standard beep/“bell” sound, as might be used for a notification or error.
Happened
A sound suitable for “something was activated or done”, e.g. a button was clicked.
BlockFault(BlockFault)
Something went wrong with the operation of a block present as placed in a Space.
PlaceBlockGeneric
Sound and visual effect from a block having been placed in the game world by player action, without any more specific overriding styling.
#[non_exhaustive]BlockImpact
Collision between a block and a moving object.
Fields
This variant is marked as non-exhaustive
velocity: PositiveSign<f32>Closing velocity in m/s.
Implementations§
Source§impl Fluff
impl Fluff
Sourcepub fn sound(&self) -> Option<(&'static SoundDef, f32)>
pub fn sound(&self) -> Option<(&'static SoundDef, f32)>
Returns the sound that should be played and the amplitude multiplier with which it should be played.
Whether or not this sound should be spatialized depends on the context in which the
Fluff was delivered.
TODO: The return value shouldn’t be 'static but a Handle; this is a development
placeholder.
Trait Implementations§
Source§impl VisitHandles for Fluff
impl VisitHandles for Fluff
Source§fn visit_handles(&self, _: &mut dyn HandleVisitor)
fn visit_handles(&self, _: &mut dyn HandleVisitor)
impl Eq for Fluff
impl StructuralPartialEq for Fluff
Auto Trait Implementations§
impl Freeze for Fluff
impl RefUnwindSafe for Fluff
impl Send for Fluff
impl Sync for Fluff
impl Unpin for Fluff
impl UnwindSafe for Fluff
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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