rust/landgen/src/wavefront_collapse/generator.rs
changeset 16077 aba25f4e4645
parent 16075 2c2b094e6bbe
child 16079 65c017453e83
--- a/rust/landgen/src/wavefront_collapse/generator.rs	Thu Jan 30 13:59:41 2025 +0100
+++ b/rust/landgen/src/wavefront_collapse/generator.rs	Thu Jan 30 16:38:00 2025 +0100
@@ -27,6 +27,7 @@
 #[derive(Debug, Clone)]
 pub struct TileDescription {
     pub name: String,
+    pub weight: u8,
     pub edges: EdgesDescription,
     pub is_negative: Option<bool>,
     pub can_flip: Option<bool>,
@@ -137,7 +138,7 @@
         ];
 
         let tile =
-            TileImage::<T, String>::new(tiles_image, top_edge, right_edge, bottom_edge, left_edge);
+            TileImage::<T, String>::new(tiles_image, tile_description.weight, top_edge, right_edge, bottom_edge, left_edge);
 
         result.push(tile.clone());
 
@@ -278,7 +279,7 @@
                 - probability_distribution_factor) as u32;
 
             rules.push(CollapseRule {
-                weight,
+                weight: weight * tile.weight as u32 + 1,
                 tile: Tile::Numbered(i),
                 top,
                 right,