#[non_exhaustive]pub struct LevelUpEvent {
pub player_entity_id: Entity,
pub level: u32,
}Expand description
A character reached a new level.
§Examples
use enshwick::game_events::LevelUpEvent;
fn init(load: &mut enshwick::Load<'_>) -> Result<(), enshwick::Off> {
load.on::<LevelUpEvent>(|up| enshwick::info!("entity {} reached level {}", up.player_entity_id.0, up.level))
}Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.player_entity_id: EntityThe player’s character.
level: u32The level reached.
Trait Implementations§
Source§impl Clone for LevelUpEvent
impl Clone for LevelUpEvent
impl Copy for LevelUpEvent
Source§impl Debug for LevelUpEvent
impl Debug for LevelUpEvent
impl Eq for LevelUpEvent
Source§impl FromScript for LevelUpEvent
impl FromScript for LevelUpEvent
Source§impl IntoScript for LevelUpEvent
impl IntoScript for LevelUpEvent
Source§fn into_value(self) -> Value
fn into_value(self) -> Value
Available on crate feature
unstable only.The value as
Typed::TY shapes it.Source§impl Kind for LevelUpEvent
impl Kind for LevelUpEvent
Source§type Data = LevelUpEvent
type Data = LevelUpEvent
What a handler gets: an ABI struct or
() for a loader event, the
event itself for a game event.Source§impl PartialEq for LevelUpEvent
impl PartialEq for LevelUpEvent
impl StructuralPartialEq for LevelUpEvent
Auto Trait Implementations§
impl Freeze for LevelUpEvent
impl RefUnwindSafe for LevelUpEvent
impl Send for LevelUpEvent
impl Sync for LevelUpEvent
impl Unpin for LevelUpEvent
impl UnsafeUnpin for LevelUpEvent
impl UnwindSafe for LevelUpEvent
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