diff options
| author | Freya Murphy <freya@freyacat.org> | 2025-10-16 11:06:01 -0400 |
|---|---|---|
| committer | Freya Murphy <freya@freyacat.org> | 2025-10-16 11:06:01 -0400 |
| commit | aaf194e209ebe55cafbf6ff266ca4567faa09e6f (patch) | |
| tree | 1c9c7e054d7d3416bc5b789935b5bb320233c6ca /dungeon/src/lib.rs | |
| parent | graphics: create Renderer struct (diff) | |
| download | DungeonCrawl-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.rs | 24 |
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 { |