summaryrefslogtreecommitdiff
path: root/dungeon/src/lib.rs
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2025-10-16 11:06:01 -0400
committerFreya Murphy <freya@freyacat.org>2025-10-16 11:06:01 -0400
commitaaf194e209ebe55cafbf6ff266ca4567faa09e6f (patch)
tree1c9c7e054d7d3416bc5b789935b5bb320233c6ca /dungeon/src/lib.rs
parentgraphics: create Renderer struct (diff)
downloadDungeonCrawl-aaf194e209ebe55cafbf6ff266ca4567faa09e6f.tar.gz
DungeonCrawl-aaf194e209ebe55cafbf6ff266ca4567faa09e6f.tar.bz2
DungeonCrawl-aaf194e209ebe55cafbf6ff266ca4567faa09e6f.zip
dungeon: add more getters and lib fns
Diffstat (limited to 'dungeon/src/lib.rs')
-rw-r--r--dungeon/src/lib.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/dungeon/src/lib.rs b/dungeon/src/lib.rs
index 84fc339..cc15455 100644
--- a/dungeon/src/lib.rs
+++ b/dungeon/src/lib.rs
@@ -49,6 +49,30 @@ impl Dungeon {
Self { player, floor }
}
+
+ /// Returns a reference to the player
+ #[must_use]
+ pub fn player(&self) -> &Entity {
+ &self.player
+ }
+
+ /// Returns a mutable reference to the player
+ #[must_use]
+ pub fn player_mut(&mut self) -> &mut Entity {
+ &mut self.player
+ }
+
+ /// Returns a reference to the current floor
+ #[must_use]
+ pub fn floor(&self) -> &Floor {
+ &self.floor
+ }
+
+ /// Returns a mutable reference to the current floor
+ #[must_use]
+ pub fn floor_mut(&mut self) -> &mut Floor {
+ &mut self.floor
+ }
}
impl Default for Dungeon {