pub struct GameEventContext<'a> {
source_entity: Option<&'a dyn Entity>,
affected_state: Option<BlockStateId>,
}Expand description
The context for a game event
Fields§
§source_entity: Option<&'a dyn Entity>The entity that caused the game event
affected_state: Option<BlockStateId>The block state involved in the game event
Implementations§
Source§impl<'a> GameEventContext<'a>
impl<'a> GameEventContext<'a>
Sourcepub fn new(
source_entity: Option<&'a dyn Entity>,
affected_state: Option<BlockStateId>,
) -> Self
pub fn new( source_entity: Option<&'a dyn Entity>, affected_state: Option<BlockStateId>, ) -> Self
Creates a new GameEventContext
Sourcepub fn source_entity(&self) -> Option<&'a dyn Entity>
pub fn source_entity(&self) -> Option<&'a dyn Entity>
Returns the entity that caused the game event.
Sourcepub const fn affected_state(&self) -> Option<BlockStateId>
pub const fn affected_state(&self) -> Option<BlockStateId>
Returns the block state involved in the game event.
Trait Implementations§
Source§impl<'a> Clone for GameEventContext<'a>
impl<'a> Clone for GameEventContext<'a>
Source§fn clone(&self) -> GameEventContext<'a>
fn clone(&self) -> GameEventContext<'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 moreSource§impl<'a> Default for GameEventContext<'a>
impl<'a> Default for GameEventContext<'a>
Source§fn default() -> GameEventContext<'a>
fn default() -> GameEventContext<'a>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for GameEventContext<'a>
impl<'a> !UnwindSafe for GameEventContext<'a>
impl<'a> Freeze for GameEventContext<'a>
impl<'a> Send for GameEventContext<'a>
impl<'a> Sync for GameEventContext<'a>
impl<'a> Unpin for GameEventContext<'a>
impl<'a> UnsafeUnpin for GameEventContext<'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<>>