pub struct LivingSwingState {
current_swing: Option<SwingDescription>,
swing_time: i32,
old_attack_anim: f32,
attack_anim: f32,
}Expand description
Arm-swing animation state stored on a living entity.
Fields§
§current_swing: Option<SwingDescription>§swing_time: i32§old_attack_anim: f32§attack_anim: f32Implementations§
Source§impl LivingSwingState
impl LivingSwingState
Sourcepub const fn swinging(self) -> bool
pub const fn swinging(self) -> bool
Returns whether an arm-swing animation is currently playing.
Sourcepub const fn swinging_arm(self) -> Option<InteractionHand>
pub const fn swinging_arm(self) -> Option<InteractionHand>
Returns which hand is currently swinging, if any.
Sourcepub const fn swing_time(self) -> i32
pub const fn swing_time(self) -> i32
Returns ticks elapsed in the current arm-swing animation.
Sourcepub const fn old_attack_anim(self) -> f32
pub const fn old_attack_anim(self) -> f32
Returns the previous-tick animation progress for interpolation.
Sourcepub const fn attack_anim(self) -> f32
pub const fn attack_anim(self) -> f32
Returns the current attack animation progress.
Trait Implementations§
Source§impl Clone for LivingSwingState
impl Clone for LivingSwingState
impl Copy for LivingSwingState
Source§impl Debug for LivingSwingState
impl Debug for LivingSwingState
Source§impl Default for LivingSwingState
impl Default for LivingSwingState
Source§impl PartialEq for LivingSwingState
impl PartialEq for LivingSwingState
impl StructuralPartialEq for LivingSwingState
Auto Trait Implementations§
impl Freeze for LivingSwingState
impl RefUnwindSafe for LivingSwingState
impl Send for LivingSwingState
impl Sync for LivingSwingState
impl Unpin for LivingSwingState
impl UnsafeUnpin for LivingSwingState
impl UnwindSafe for LivingSwingState
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<>>