From aaf194e209ebe55cafbf6ff266ca4567faa09e6f Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Thu, 16 Oct 2025 11:06:01 -0400 Subject: dungeon: add more getters and lib fns --- dungeon/src/lib.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'dungeon/src/lib.rs') 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 { -- cgit v1.2.3-freya