summaryrefslogtreecommitdiff
path: root/dungeon/src/entity.rs
diff options
context:
space:
mode:
Diffstat (limited to 'dungeon/src/entity.rs')
-rw-r--r--dungeon/src/entity.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/dungeon/src/entity.rs b/dungeon/src/entity.rs
index 592c1ee..f56f8dd 100644
--- a/dungeon/src/entity.rs
+++ b/dungeon/src/entity.rs
@@ -323,6 +323,11 @@ impl Entity {
next_move = *last;
}
}
+
+ /// Returns the position in front of the entity
+ pub const fn in_front(&self) -> Option<Pos> {
+ self.pos.step(self.dir)
+ }
}
/// The `Player` type represents the main player entity