rust/landgen/src/wavefront_collapse/tile_image.rs
branchtransitional_engine
changeset 15943 c5684cc62de8
child 15945 8f093b1b18bc
--- /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<Land2D<u8>>,
+    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
+        }
+    }
+}