summaryrefslogtreecommitdiff
path: root/dungeon/src/pos.rs
diff options
context:
space:
mode:
authoralf9310 <alf9310@rit.edu>2025-10-17 10:30:42 -0400
committeralf9310 <alf9310@rit.edu>2025-10-17 10:30:42 -0400
commit0915e49c033fcb364feb307e2998a24833f4ae0f (patch)
tree9713dccb4920a1645547a3ab2cb7cc31b946c4e2 /dungeon/src/pos.rs
parentProposal summary and use cases complete (diff)
parentdungeon: make const_pos! not require name param (diff)
downloadDungeonCrawl-0915e49c033fcb364feb307e2998a24833f4ae0f.tar.gz
DungeonCrawl-0915e49c033fcb364feb307e2998a24833f4ae0f.tar.bz2
DungeonCrawl-0915e49c033fcb364feb307e2998a24833f4ae0f.zip
Merge branch 'main' of https://git.gccis.rit.edu/psr2251/project/DungeonCrawl
Diffstat (limited to 'dungeon/src/pos.rs')
-rw-r--r--dungeon/src/pos.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/dungeon/src/pos.rs b/dungeon/src/pos.rs
index a1de65e..4947ce2 100644
--- a/dungeon/src/pos.rs
+++ b/dungeon/src/pos.rs
@@ -17,9 +17,10 @@ macro_rules! downcast {
#[macro_export]
macro_rules! const_pos {
- ($name:ident, $x:expr, $y:expr) => {
- const $name: Pos = Pos::new_unchecked($x, $y);
- };
+ ($x:expr, $y:expr) => {{
+ const CONST_POS: Pos = Pos::new_unchecked($x, $y);
+ CONST_POS
+ }};
}
/// The `Direction` type represents a direction an entity
@@ -249,7 +250,6 @@ impl Default for Pos {
/// ```
///
fn default() -> Self {
- const_pos!(DEFAULT, 0, 0);
- DEFAULT
+ const_pos!(0, 0)
}
}