pub struct Parameter {
pub min: i64,
pub max: i64,
}Expand description
A parameter range for biome matching.
Represents a range [min, max] that a climate parameter can match. A point matches if it falls within this range; distance is 0 inside and increases linearly outside.
Fields§
§min: i64Minimum value (quantized)
max: i64Maximum value (quantized)
Implementations§
Source§impl Parameter
impl Parameter
Sourcepub const fn span_params(min: &Parameter, max: &Parameter) -> Self
pub const fn span_params(min: &Parameter, max: &Parameter) -> Self
Create a parameter span from two parameters.
Sourcepub const fn distance(&self, target: i64) -> i64
pub const fn distance(&self, target: i64) -> i64
Calculate the distance from a target value to this parameter range.
Returns 0 if the target is within the range, otherwise the distance to the nearest edge.
Sourcepub const fn distance_param(&self, target: &Parameter) -> i64
pub const fn distance_param(&self, target: &Parameter) -> i64
Calculate the distance between two parameter ranges.
Trait Implementations§
impl Copy for Parameter
impl Eq for Parameter
impl StructuralPartialEq for Parameter
Auto Trait Implementations§
impl Freeze for Parameter
impl RefUnwindSafe for Parameter
impl Send for Parameter
impl Sync for Parameter
impl Unpin for Parameter
impl UnsafeUnpin for Parameter
impl UnwindSafe for Parameter
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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
Compare self to
key and return true if they are equal.