pub struct ParameterPoint {
pub temperature: Parameter,
pub humidity: Parameter,
pub continentalness: Parameter,
pub erosion: Parameter,
pub depth: Parameter,
pub weirdness: Parameter,
pub offset: i64,
}Expand description
A biome’s full parameter specification.
Contains ranges for all 6 climate parameters plus an offset value used as a tiebreaker in biome selection.
Fields§
§temperature: ParameterTemperature range
humidity: ParameterHumidity range
continentalness: ParameterContinentalness range
erosion: ParameterErosion range
depth: ParameterDepth range
weirdness: ParameterWeirdness range
offset: i64Offset (quantized) - used as tiebreaker
Implementations§
Source§impl ParameterPoint
impl ParameterPoint
Sourcepub const fn new(
temperature: Parameter,
humidity: Parameter,
continentalness: Parameter,
erosion: Parameter,
depth: Parameter,
weirdness: Parameter,
offset: i64,
) -> Self
pub const fn new( temperature: Parameter, humidity: Parameter, continentalness: Parameter, erosion: Parameter, depth: Parameter, weirdness: Parameter, offset: i64, ) -> Self
Create a new parameter point.
Sourcepub const fn fitness(&self, target: &TargetPoint) -> i64
pub const fn fitness(&self, target: &TargetPoint) -> i64
Calculate the fitness (distance) between this parameter point and a target.
Lower fitness = better match. Uses squared distances.
Sourcepub const fn parameter_space(&self) -> [Parameter; 7]
pub const fn parameter_space(&self) -> [Parameter; 7]
Get the parameter space as a slice of parameters.
Trait Implementations§
Source§impl Clone for ParameterPoint
impl Clone for ParameterPoint
Source§fn clone(&self) -> ParameterPoint
fn clone(&self) -> ParameterPoint
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ParameterPoint
Auto Trait Implementations§
impl Freeze for ParameterPoint
impl RefUnwindSafe for ParameterPoint
impl Send for ParameterPoint
impl Sync for ParameterPoint
impl Unpin for ParameterPoint
impl UnsafeUnpin for ParameterPoint
impl UnwindSafe for ParameterPoint
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