pub struct ActiveStatusEffect { /* private fields */ }Expand description
Represents an active status effect.
Implementations§
Source§impl ActiveStatusEffect
impl ActiveStatusEffect
Sourcepub fn from_effect(effect: StatusEffect) -> Self
pub fn from_effect(effect: StatusEffect) -> Self
Creates a new ActiveStatusEffect.
Sourcepub fn with_amplifier(self, amplifier: i32) -> Self
pub fn with_amplifier(self, amplifier: i32) -> Self
Sets the amplifier of the ActiveStatusEffect.
Sourcepub fn with_duration(self, duration: i32) -> Self
pub fn with_duration(self, duration: i32) -> Self
Sets the duration of the ActiveStatusEffect in ticks.
Sourcepub fn with_duration_seconds(self, duration: f32) -> Self
pub fn with_duration_seconds(self, duration: f32) -> Self
Sets the duration of the ActiveStatusEffect in seconds.
Sourcepub fn with_infinite(self) -> Self
pub fn with_infinite(self) -> Self
Sets the duration of the ActiveStatusEffect to infinite.
Sourcepub fn with_ambient(self, ambient: bool) -> Self
pub fn with_ambient(self, ambient: bool) -> Self
Sets whether the ActiveStatusEffect is ambient.
Sourcepub fn with_show_particles(self, show_particles: bool) -> Self
pub fn with_show_particles(self, show_particles: bool) -> Self
Sets whether the ActiveStatusEffect shows particles.
Sourcepub fn with_show_icon(self, show_icon: bool) -> Self
pub fn with_show_icon(self, show_icon: bool) -> Self
Sets whether the ActiveStatusEffect shows an icon.
Sourcepub fn increment_active_ticks(&mut self)
pub fn increment_active_ticks(&mut self)
Increments the active ticks of the ActiveStatusEffect by one.
Sourcepub fn status_effect(&self) -> StatusEffect
pub fn status_effect(&self) -> StatusEffect
Returns the StatusEffect of the ActiveStatusEffect.
Sourcepub fn amplifier(&self) -> i32
pub fn amplifier(&self) -> i32
Returns the amplifier of the ActiveStatusEffect.
Sourcepub fn initial_duration(&self) -> Option<i32>
pub fn initial_duration(&self) -> Option<i32>
Returns the initial duration of the ActiveStatusEffect in ticks.
Returns None if the ActiveStatusEffect is infinite.
Sourcepub fn remaining_duration(&self) -> Option<i32>
pub fn remaining_duration(&self) -> Option<i32>
Returns the remaining duration of the ActiveStatusEffect in ticks.
Returns None if the ActiveStatusEffect is infinite.
Sourcepub fn active_ticks(&self) -> i32
pub fn active_ticks(&self) -> i32
Returns the active ticks of the ActiveStatusEffect.
Sourcepub fn ambient(&self) -> bool
pub fn ambient(&self) -> bool
Returns true if the ActiveStatusEffect is ambient.
Sourcepub fn show_particles(&self) -> bool
pub fn show_particles(&self) -> bool
Returns true if the ActiveStatusEffect shows particles.
Sourcepub fn show_icon(&self) -> bool
pub fn show_icon(&self) -> bool
Returns true if the ActiveStatusEffect shows an icon.
Sourcepub fn expired(&self) -> bool
pub fn expired(&self) -> bool
Returns true if the ActiveStatusEffect has expired or if it is
instant.
Trait Implementations§
Source§impl Clone for ActiveStatusEffect
impl Clone for ActiveStatusEffect
Source§fn clone(&self) -> ActiveStatusEffect
fn clone(&self) -> ActiveStatusEffect
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ActiveStatusEffect
impl Debug for ActiveStatusEffect
Source§impl Hash for ActiveStatusEffect
impl Hash for ActiveStatusEffect
Source§impl Ord for ActiveStatusEffect
impl Ord for ActiveStatusEffect
Source§fn cmp(&self, other: &ActiveStatusEffect) -> Ordering
fn cmp(&self, other: &ActiveStatusEffect) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for ActiveStatusEffect
impl PartialEq for ActiveStatusEffect
Source§fn eq(&self, other: &ActiveStatusEffect) -> bool
fn eq(&self, other: &ActiveStatusEffect) -> bool
self and other values to be equal, and is used by ==.Source§impl PartialOrd for ActiveStatusEffect
impl PartialOrd for ActiveStatusEffect
impl Eq for ActiveStatusEffect
impl StructuralPartialEq for ActiveStatusEffect
Auto Trait Implementations§
impl Freeze for ActiveStatusEffect
impl RefUnwindSafe for ActiveStatusEffect
impl Send for ActiveStatusEffect
impl Sync for ActiveStatusEffect
impl Unpin for ActiveStatusEffect
impl UnsafeUnpin for ActiveStatusEffect
impl UnwindSafe for ActiveStatusEffect
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DynEq for T
impl<T> DynEq for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.