diff options
| author | alf9310 <alf9310@rit.edu> | 2025-10-23 12:42:25 -0400 |
|---|---|---|
| committer | alf9310 <alf9310@rit.edu> | 2025-10-23 12:42:25 -0400 |
| commit | 4a28fcd7918eb3a347982bee61c98cf1836278b8 (patch) | |
| tree | 6afd01c8cbf555f104326f3ee1d8f70d1b2bc74c /dungeon/src/map.rs | |
| parent | Feedback and grade for Proposal (diff) | |
| download | DungeonCrawl-4a28fcd7918eb3a347982bee61c98cf1836278b8.tar.gz DungeonCrawl-4a28fcd7918eb3a347982bee61c98cf1836278b8.tar.bz2 DungeonCrawl-4a28fcd7918eb3a347982bee61c98cf1836278b8.zip | |
Started implementing wfc crate into map
Diffstat (limited to 'dungeon/src/map.rs')
| -rw-r--r-- | dungeon/src/map.rs | 19 |
1 files changed, 18 insertions, 1 deletions
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<Tile> { + 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!() } |