pub struct MidpointDisplacement { /* private fields */ }Expand description
Implementations§
Source§impl MidpointDisplacement
impl MidpointDisplacement
Sourcepub fn get_length(&self) -> usize
pub fn get_length(&self) -> usize
Get the initial size of the terrain.
§Examples
let mut cfg = MidpointDisplacement::default();
assert_eq!(cfg.get_length(), 4);Sourcepub fn get_map_length(&self) -> usize
pub fn get_map_length(&self) -> usize
Get the initial size of the terrain.
§Examples
let mut cfg = MidpointDisplacement::default();
assert_eq!(cfg.get_map_length(), 17);Sourcepub fn set_length(&mut self, length: usize)
pub fn set_length(&mut self, length: usize)
Get the initial size of the terrain.
§Examples
let mut cfg = MidpointDisplacement::default();
cfg.set_length(8);
assert_eq!(cfg.get_length(), 8);Sourcepub fn with_length(self, length: usize) -> Self
pub fn with_length(self, length: usize) -> Self
Get the initial size of the terrain.
§Examples
let mut cfg = MidpointDisplacement::default().with_length(10);
assert_eq!(cfg.get_length(), 10);Sourcepub fn get_iteration(&self) -> u32
pub fn get_iteration(&self) -> u32
Get the initial size of the terrain.
§Examples
let mut cfg = MidpointDisplacement::default();
assert_eq!(cfg.get_iteration(), 2);Sourcepub fn set_iteration(&mut self, iteration: u32)
pub fn set_iteration(&mut self, iteration: u32)
Get the initial size of the terrain.
§Examples
let mut cfg = MidpointDisplacement::default();
cfg.set_iteration(10);
assert_eq!(cfg.get_iteration(), 10);Sourcepub fn with_iteration(self, iteration: u32) -> Self
pub fn with_iteration(self, iteration: u32) -> Self
Get the initial size of the terrain.
§Examples
let mut cfg = MidpointDisplacement::default().with_iteration(10);
assert_eq!(cfg.get_iteration(), 10);Sourcepub fn get_range(&self) -> Range<f32>
pub fn get_range(&self) -> Range<f32>
Get the initial size of the terrain.
§Examples
let mut cfg = MidpointDisplacement::default();
assert_eq!(cfg.get_range().start, -1.0);
assert_eq!(cfg.get_range().end, 1.0);Sourcepub fn set_range(&mut self, range: Range<f32>)
pub fn set_range(&mut self, range: Range<f32>)
Get the initial size of the terrain.
§Examples
let mut cfg = MidpointDisplacement::default();
cfg.set_range(0.0..1.0);
assert_eq!(cfg.get_range().start, 0.0);
assert_eq!(cfg.get_range().end, 1.0);Sourcepub fn with_range(self, range: Range<f32>) -> Self
pub fn with_range(self, range: Range<f32>) -> Self
Get the initial size of the terrain.
§Examples
let mut cfg = MidpointDisplacement::default().with_range(0.0..1.0);
assert_eq!(cfg.get_range().start, 0.0);
assert_eq!(cfg.get_range().end, 1.0);Sourcepub fn get_roughness(&self) -> f32
pub fn get_roughness(&self) -> f32
Get the initial size of the terrain.
§Examples
let mut cfg = MidpointDisplacement::default();
assert_eq!(cfg.get_roughness(), 1.1);Sourcepub fn set_roughness(&mut self, roughness: f32)
pub fn set_roughness(&mut self, roughness: f32)
Get the initial size of the terrain.
§Examples
let mut cfg = MidpointDisplacement::default();
cfg.set_roughness(2.0);
assert_eq!(cfg.get_roughness(), 2.0);Sourcepub fn with_roughness(self, roughness: f32) -> Self
pub fn with_roughness(self, roughness: f32) -> Self
Get the initial size of the terrain.
§Examples
let mut cfg = MidpointDisplacement::default().with_roughness(2.0);
assert_eq!(cfg.get_roughness(), 2.0);Sourcepub fn get_seed(&self) -> u64
pub fn get_seed(&self) -> u64
Get the initial size of the terrain.
§Examples
let mut cfg = MidpointDisplacement::default();
assert_eq!(cfg.get_seed(), 42);Trait Implementations§
Source§impl Clone for MidpointDisplacement
impl Clone for MidpointDisplacement
Source§fn clone(&self) -> MidpointDisplacement
fn clone(&self) -> MidpointDisplacement
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 MidpointDisplacement
impl Debug for MidpointDisplacement
Source§impl Default for MidpointDisplacement
impl Default for MidpointDisplacement
Source§impl<'de> Deserialize<'de> for MidpointDisplacement
impl<'de> Deserialize<'de> for MidpointDisplacement
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
Source§impl PartialEq for MidpointDisplacement
impl PartialEq for MidpointDisplacement
Source§impl Serialize for MidpointDisplacement
impl Serialize for MidpointDisplacement
impl StructuralPartialEq for MidpointDisplacement
Auto Trait Implementations§
impl Freeze for MidpointDisplacement
impl RefUnwindSafe for MidpointDisplacement
impl Send for MidpointDisplacement
impl Sync for MidpointDisplacement
impl Unpin for MidpointDisplacement
impl UnwindSafe for MidpointDisplacement
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