From ff627e369f83fdaab8e90016529521b0e07d5e34 Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Thu, 20 Nov 2025 20:27:50 -0500 Subject: dungeon: add chest usage/textures --- dungeon/src/entity.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'dungeon/src/entity.rs') diff --git a/dungeon/src/entity.rs b/dungeon/src/entity.rs index 5b4ac38..22ac3e5 100644 --- a/dungeon/src/entity.rs +++ b/dungeon/src/entity.rs @@ -1,6 +1,6 @@ //! The `entity` module contains structures of all entities including players and enimies. -use std::mem::take; +use std::{fmt::Display, mem::take}; use rand::Rng; @@ -71,6 +71,17 @@ impl Item { matches!(self, Self::HealthPotion | Self::SpeedPotion) } } +impl Display for Item { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::HeartFragment => f.write_str("Heart Fragment"), + Self::HealthPotion => f.write_str("Health Potion"), + Self::SpeedPotion => f.write_str("Speed Potion"), + Self::Bomb => f.write_str("Bomb"), + Self::LargeBomb => f.write_str("Large Bomb"), + } + } +} /// Different speed entities can move #[repr(u8)] -- cgit v1.2.3-freya