pub enum StatConditionType {
MinValue(f64),
BetweenValue(f64, f64),
MaxValue(f64),
MinPercent(f64),
BetweenPercent(f64, f64),
MaxPercent(f64),
DivisibleBy(i32),
}
Expand description
A condition based on a stat’s value.
Variants§
MinValue(f64)
The stat value must be higher or equal to this value.
BetweenValue(f64, f64)
The stat value must be between these values.
MaxValue(f64)
The stat value must be lower or equal to this value.
MinPercent(f64)
The minimum progress of the value between its minimum and maximum. This calculates the distance between the minimum and maximum values, then assigns a value between 0.0 and 1.0 that correspond to the absolute distance from the minimum. If the minimum value is 10 and the maximum is 20 and we have a value of 15, then this corresponds to a “distance” of 0.5 (50%!) of the way between 10 and 20.
BetweenPercent(f64, f64)
The minimum progress of the value between its minimum and maximum. This calculates the distance between the minimum and maximum values, then assigns a value between 0.0 and 1.0 that correspond to the absolute distance from the minimum. If the minimum value is 10 and the maximum is 20 and we have a value of 15, then this corresponds to a “distance” of 0.5 (50%!) of the way between 10 and 20.
MaxPercent(f64)
The minimum progress of the value between its minimum and maximum. This calculates the distance between the minimum and maximum values, then assigns a value between 0.0 and 1.0 that correspond to the absolute distance from the minimum. If the minimum value is 10 and the maximum is 20 and we have a value of 15, then this corresponds to a “distance” of 0.5 (50%!) of the way between 10 and 20.
DivisibleBy(i32)
The value is divisible by this value. DivisibleBy(2) is equivalent to (value % 2 == 0).
Implementations§
Source§impl StatConditionType
impl StatConditionType
Sourcepub fn new_min_value(f0: f64) -> Self
pub fn new_min_value(f0: f64) -> Self
Constructs a new StatConditionType::MinValue
.
Source§impl StatConditionType
impl StatConditionType
Sourcepub fn new_between_value(f0: f64, f1: f64) -> Self
pub fn new_between_value(f0: f64, f1: f64) -> Self
Constructs a new StatConditionType::BetweenValue
.
Source§impl StatConditionType
impl StatConditionType
Sourcepub fn new_max_value(f0: f64) -> Self
pub fn new_max_value(f0: f64) -> Self
Constructs a new StatConditionType::MaxValue
.
Source§impl StatConditionType
impl StatConditionType
Sourcepub fn new_min_percent(f0: f64) -> Self
pub fn new_min_percent(f0: f64) -> Self
Constructs a new StatConditionType::MinPercent
.
Source§impl StatConditionType
impl StatConditionType
Sourcepub fn new_between_percent(f0: f64, f1: f64) -> Self
pub fn new_between_percent(f0: f64, f1: f64) -> Self
Constructs a new StatConditionType::BetweenPercent
.
Source§impl StatConditionType
impl StatConditionType
Sourcepub fn new_max_percent(f0: f64) -> Self
pub fn new_max_percent(f0: f64) -> Self
Constructs a new StatConditionType::MaxPercent
.
Source§impl StatConditionType
impl StatConditionType
Sourcepub fn new_divisible_by(f0: i32) -> Self
pub fn new_divisible_by(f0: i32) -> Self
Constructs a new StatConditionType::DivisibleBy
.
Trait Implementations§
Source§impl Clone for StatConditionType
impl Clone for StatConditionType
Source§fn clone(&self) -> StatConditionType
fn clone(&self) -> StatConditionType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more