summaryrefslogtreecommitdiff
path: root/dungeon/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'dungeon/src/lib.rs')
-rw-r--r--dungeon/src/lib.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/dungeon/src/lib.rs b/dungeon/src/lib.rs
index 75400e9..0e1a501 100644
--- a/dungeon/src/lib.rs
+++ b/dungeon/src/lib.rs
@@ -12,7 +12,7 @@ pub use pos::*;
/// The `Dungeon` type represents the game state of the
/// dungeon crawler.
-#[derive(Clone, Debug, PartialEq, Eq, Hash)]
+#[derive(Clone, Debug, PartialEq)]
pub struct Dungeon {
pub floor: Floor,
pub player: Player,
@@ -46,6 +46,12 @@ impl Dungeon {
pub fn new_seeded(seed: u64) -> Self {
Self::from(Floor::generate_seeded(seed))
}
+
+ /// Returns the current position of the camera (viewer)
+ #[must_use]
+ pub fn camera(&self) -> FPos {
+ self.player.entity.fpos
+ }
}
impl Default for Dungeon {
fn default() -> Self {