From: Huck Boles Date: Mon, 10 Jul 2023 23:41:16 +0000 (-0500) Subject: fixed: more intuitive loop behavior X-Git-Url: https://git.huck.website/?a=commitdiff_plain;h=d63dc0bab06fa111b23578df899e5c85e0ef1e08;p=cellseq.git fixed: more intuitive loop behavior --- diff --git a/src/map.rs b/src/map.rs index 79da34b..89f7924 100644 --- a/src/map.rs +++ b/src/map.rs @@ -17,6 +17,7 @@ use std::fmt::Debug; #[derive(Debug)] pub struct Map { seed: CellMap, + loop_point: CellMap, cells: CellMap, life_cache: Cache, randomness: f32, @@ -27,6 +28,7 @@ impl Default for Map { Self { seed: CellMap::default(), cells: CellMap::default(), + loop_point: CellMap::default(), life_cache: Cache::default(), randomness: 0.5, } @@ -41,8 +43,12 @@ pub enum Message { } impl Map { + pub fn set_loop(&mut self) { + self.loop_point = self.cells.clone(); + } + pub fn reset_loop(&mut self) -> CellMap { - self.seed.clone() + self.loop_point.clone() } pub fn tick(&self) -> CellMap {