From fd038ef32f51ff2b19cc2331a9d6f319cd55eb5a Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Wed, 8 Oct 2025 19:24:16 -0400 Subject: further improve const fns for Pos --- dungeon/src/map.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'dungeon/src/map.rs') 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; -- cgit v1.2.3-freya