From 4a28fcd7918eb3a347982bee61c98cf1836278b8 Mon Sep 17 00:00:00 2001 From: alf9310 Date: Thu, 23 Oct 2025 12:42:25 -0400 Subject: Started implementing wfc crate into map --- dungeon/src/map.rs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'dungeon/src/map.rs') diff --git a/dungeon/src/map.rs b/dungeon/src/map.rs index f962180..d9a4323 100644 --- a/dungeon/src/map.rs +++ b/dungeon/src/map.rs @@ -1,6 +1,7 @@ //! The `map` module contains structures of the dungeon game map //! including the current `Floor`, and map `Tile`. +use crate::wfc::Wfc; use crate::{const_pos, pos::Pos}; /// `MAP_SIZE` is the size of the size of the dungeon grid. @@ -20,6 +21,17 @@ pub enum Tile { Wall, /// `Air` represents empty walkable space Air, + /// `Stairs` represents stairs to another floor + Stairs, +} + +impl Tile { + /// Returns a list of all possible tiles + /// TODO! Use a crate for enum itterator + #[must_use] + pub fn all_tiles() -> Vec { + vec![Tile::Wall, Tile::Air, Tile::Stairs] + } } /// The `Floor` type represents the current playing @@ -65,7 +77,12 @@ impl Floor { /// let floor = Floor::generate_seeded(seed); /// ``` #[must_use] - pub fn generate_seeded(_seed: u64) -> Self { + pub fn generate_seeded(seed: u64) -> Self { + let mut wfc = Wfc::new(seed, MAP_SIZE); + wfc.initialize_states(); + wfc.run(); + + // TODO unimplemented!() } -- cgit v1.2.3-freya