pub struct EffectorDefinition<K, E> {
pub key: E,
pub duration: Option<f64>,
pub effects: Vec<(K, EffectorType)>,
}Expand description
The definition of a stat effector. This modifies temporarily the value of a stat.
Fields§
§key: EThe key of the effector.
duration: Option<f64>The duration of the effector. None means that it does not expire. Some(0) means that it is applied only once. Some(n) means that it is applied for n seconds.
effects: Vec<(K, EffectorType)>The effects that cause this effector. Note that effectors can only cause effects on a single stat. To affect multiple stats, create multiple effectors.
Implementations§
Source§impl<K, E> EffectorDefinition<K, E>
impl<K, E> EffectorDefinition<K, E>
Trait Implementations§
Source§impl<K: Clone, E: Clone> Clone for EffectorDefinition<K, E>
impl<K: Clone, E: Clone> Clone for EffectorDefinition<K, E>
Source§fn clone(&self) -> EffectorDefinition<K, E>
fn clone(&self) -> EffectorDefinition<K, E>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'de, K, E> Deserialize<'de> for EffectorDefinition<K, E>where
K: Deserialize<'de>,
E: Deserialize<'de>,
impl<'de, K, E> Deserialize<'de> for EffectorDefinition<K, E>where
K: Deserialize<'de>,
E: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl<K, E> Freeze for EffectorDefinition<K, E>where
E: Freeze,
impl<K, E> RefUnwindSafe for EffectorDefinition<K, E>where
E: RefUnwindSafe,
K: RefUnwindSafe,
impl<K, E> Send for EffectorDefinition<K, E>
impl<K, E> Sync for EffectorDefinition<K, E>
impl<K, E> Unpin for EffectorDefinition<K, E>
impl<K, E> UnwindSafe for EffectorDefinition<K, E>where
E: UnwindSafe,
K: UnwindSafe,
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