summaryrefslogtreecommitdiff
path: root/dungeon/src/map.rs
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2025-10-08 19:24:16 -0400
committerFreya Murphy <freya@freyacat.org>2025-10-08 19:37:16 -0400
commitfd038ef32f51ff2b19cc2331a9d6f319cd55eb5a (patch)
tree6fa99679e697828347af1e15d41cbd2ebb2106e3 /dungeon/src/map.rs
parentadd some functionality to Pos (diff)
downloadDungeonCrawl-fd038ef32f51ff2b19cc2331a9d6f319cd55eb5a.tar.gz
DungeonCrawl-fd038ef32f51ff2b19cc2331a9d6f319cd55eb5a.tar.bz2
DungeonCrawl-fd038ef32f51ff2b19cc2331a9d6f319cd55eb5a.zip
further improve const fns for Pos
Diffstat (limited to 'dungeon/src/map.rs')
-rw-r--r--dungeon/src/map.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/dungeon/src/map.rs b/dungeon/src/map.rs
index bb83ba9..f5c1184 100644
--- a/dungeon/src/map.rs
+++ b/dungeon/src/map.rs
@@ -1,7 +1,10 @@
//! The `map` module contains structures of the dungeon game map
//! including the current `Floor`, map `Tile`, and `Entity`.
-use crate::pos::{Direction, Pos};
+use crate::{
+ const_pos,
+ pos::{Direction, Pos},
+};
/// `MAP_SIZE` is the size of the size of the dungeon grid.
pub const MAP_SIZE: u16 = 100;
@@ -193,7 +196,7 @@ impl Floor {
impl Default for Floor {
/// Returns a floor with a single set of walls on the map border
fn default() -> Self {
- const PLAYER_START: Pos = Pos::new_const::<1, 1>();
+ const_pos!(PLAYER_START, 1, 1);
let mut tiles = Box::new([Tile::Air; TILE_COUNT]);
let seed = 0u64;