pub enum StatModifier {
Flat(f32),
PercentAdd(f32),
PercentMultiply(f32),
}Expand description
Used to transform the base value of a super::Stat
Variants§
Flat(f32)
Add or subtract flat value. StatModifier::Flat(-1.0) means it will subtract -1.0
PercentAdd(f32)
Increase or decrease using procentage. StatModifier::PercentAdd(0.4) the value will increase by 40%
PercentMultiply(f32)
Direct multiplication. StatModifier::PercentMultiply(0.5) the value is halved
Implementations§
Source§impl StatModifier
impl StatModifier
Trait Implementations§
Source§impl Clone for StatModifier
impl Clone for StatModifier
Source§fn clone(&self) -> StatModifier
fn clone(&self) -> StatModifier
Returns a duplicate 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 Debug for StatModifier
impl Debug for StatModifier
Source§impl Default for StatModifier
impl Default for StatModifier
impl Copy for StatModifier
Auto Trait Implementations§
impl Freeze for StatModifier
impl RefUnwindSafe for StatModifier
impl Send for StatModifier
impl Sync for StatModifier
impl Unpin for StatModifier
impl UnwindSafe for StatModifier
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