a TON of stuff and changes

This commit is contained in:
Simon Gardling
2021-03-26 13:44:58 +00:00
parent e694c48d0a
commit 50b3f35059
11 changed files with 224 additions and 51 deletions

View File

@@ -16,6 +16,19 @@ pub struct PopulationConfig {
deposition_amount: f32,
}
impl Clone for PopulationConfig {
fn clone(&self) -> PopulationConfig {
return PopulationConfig {
sensor_distance: self.sensor_distance,
step_distance: self.step_distance,
sensor_angle: self.sensor_angle,
rotation_angle: self.rotation_angle,
decay_factor: self.decay_factor,
deposition_amount: self.deposition_amount,
}
}
}
impl Display for PopulationConfig {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
write!(
@@ -78,6 +91,20 @@ pub struct Grid {
blur: Blur,
}
impl Clone for Grid {
fn clone(&self) -> Grid {
return Grid {
config: self.config.clone(),
width: self.width.clone(),
height: self.height.clone(),
data: self.data.clone(),
buf: self.buf.clone(),
blur: self.blur.clone(),
}
// return Grid::new();
}
}
impl Grid {
/// Create a new grid filled with random floats in the [0.0..1.0) range.
pub fn new<R: Rng + ?Sized>(width: usize, height: usize, rng: &mut R) -> Self {