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: u8) -> Self
pub fn with_amplifier(self, amplifier: u8) -> 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) -> u8
pub fn amplifier(&self) -> u8
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 · 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 · 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§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 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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§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>
. Box<dyn Any>
can
then be further downcast
into Box<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>
. Rc<Any>
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> DowncastSync for T
impl<T> DowncastSync 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
§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.