summaryrefslogtreecommitdiff
path: root/dungeon/src/map.rs
diff options
context:
space:
mode:
Diffstat (limited to 'dungeon/src/map.rs')
-rw-r--r--dungeon/src/map.rs19
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!()
}