pub struct EntityFallOnContext<'a> {
pub fall_distance: f64,
pub suppresses_bounce: bool,
pub entity: EntityFallOnFacts,
pub source_entity: Option<&'a dyn Entity>,
}Expand description
Entity facts needed by Block.fallOn.
Fields§
§fall_distance: f64Accumulated vanilla fall distance at landing time.
suppresses_bounce: boolWhether vanilla bounce behavior should be suppressed.
entity: EntityFallOnFactsEntity facts available to vanilla fall-on hooks.
source_entity: Option<&'a dyn Entity>Source entity for vanilla side effects such as game events.
Implementations§
Source§impl<'a> EntityFallOnContext<'a>
impl<'a> EntityFallOnContext<'a>
Sourcepub const fn new(
fall_distance: f64,
suppresses_bounce: bool,
entity: EntityFallOnFacts,
source_entity: Option<&'a dyn Entity>,
) -> Self
pub const fn new( fall_distance: f64, suppresses_bounce: bool, entity: EntityFallOnFacts, source_entity: Option<&'a dyn Entity>, ) -> Self
Creates a fall-on context for a ground collision.
Sourcepub fn from_entity(fall_distance: f64, entity: &'a dyn Entity) -> Self
pub fn from_entity(fall_distance: f64, entity: &'a dyn Entity) -> Self
Creates a fall-on context from a landing entity.
Sourcepub const fn with_fall_distance(self, fall_distance: f64) -> Self
pub const fn with_fall_distance(self, fall_distance: f64) -> Self
Returns this context with a transformed fall distance.
Sourcepub const fn source_entity(self) -> Option<&'a dyn Entity>
pub const fn source_entity(self) -> Option<&'a dyn Entity>
Returns the source entity for vanilla side effects.
Trait Implementations§
Source§impl<'a> Clone for EntityFallOnContext<'a>
impl<'a> Clone for EntityFallOnContext<'a>
Source§fn clone(&self) -> EntityFallOnContext<'a>
fn clone(&self) -> EntityFallOnContext<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a> Copy for EntityFallOnContext<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for EntityFallOnContext<'a>
impl<'a> !UnwindSafe for EntityFallOnContext<'a>
impl<'a> Freeze for EntityFallOnContext<'a>
impl<'a> Send for EntityFallOnContext<'a>
impl<'a> Sync for EntityFallOnContext<'a>
impl<'a> Unpin for EntityFallOnContext<'a>
impl<'a> UnsafeUnpin for EntityFallOnContext<'a>
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,
§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> ⓘ
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 moreWraps this value in an
Arc<SyncMutex<>>