diff -r 6e22f4390b7e -r c5684cc62de8 rust/landgen/src/wavefront_collapse/tile_image.rs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/rust/landgen/src/wavefront_collapse/tile_image.rs Wed Feb 01 10:58:45 2023 +0100 @@ -0,0 +1,34 @@ +use land2d::Land2D; +use std::rc::Rc; + +pub struct TileImage { + image: Rc>, + flip: bool, + mirror: bool, +} + +impl TileImage { + pub fn new(flip: bool, mirror: bool) -> Self { + Self { + image: todo!(), + flip, + mirror, + } + } + + pub fn mirrored(&self) -> Self { + Self { + image: self.image.clone(), + flip: self.flip, + mirror: !self.mirror + } + } + + pub fn flipped(&self) -> Self { + Self { + image: self.image.clone(), + flip: !self.flip, + mirror: self.mirror + } + } +}