summaryrefslogtreecommitdiff
path: root/dungeon
diff options
context:
space:
mode:
Diffstat (limited to 'dungeon')
-rw-r--r--dungeon/src/map.rs13
1 files changed, 4 insertions, 9 deletions
diff --git a/dungeon/src/map.rs b/dungeon/src/map.rs
index 7403e31..9aa513f 100644
--- a/dungeon/src/map.rs
+++ b/dungeon/src/map.rs
@@ -2,8 +2,6 @@
//! including the current `Floor`, and map `Tile`.
use rand::Rng;
-use strum::IntoEnumIterator;
-use strum_macros::EnumIter;
use std::{
cell::RefCell,
@@ -11,7 +9,7 @@ use std::{
hash::{DefaultHasher, Hash, Hasher},
};
-use crate::{pos::Pos, rng::DungeonRng};
+use crate::{entity::Item, pos::Pos, rng::DungeonRng};
/// `MAP_SIZE` is the size of the size of the dungeon grid.
pub const MAP_SIZE: u16 = 48;
@@ -24,7 +22,7 @@ pub const TILE_COUNT: usize = MAP_SIZE_USIZE * MAP_SIZE_USIZE;
/// The `Tile` enum represents what is (or is not) at
/// any given spot in the dungeon grid.
-#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, EnumIter)]
+#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub enum Tile {
/// `Wall` represents an impassible wall
Wall,
@@ -34,13 +32,9 @@ pub enum Tile {
Hallway,
/// `Stairs` represents stairs to another floor
Stairs,
+ Chest(Item),
}
impl Tile {
- /// Returns a list of all possible tiles
- pub fn values() -> impl Iterator<Item = Self> {
- Self::iter()
- }
-
/// Returns if the tile is a wall
#[must_use]
pub const fn is_wall(self) -> bool {
@@ -66,6 +60,7 @@ impl Display for Tile {
Self::Room => '.',
Self::Hallway => ',',
Self::Stairs => '>',
+ Self::Chest(_) => 'C',
};
f.write_char(char)
}