diff options
author | Griffin Smith <root@gws.fyi> | 2019-07-29T15·22-0400 |
---|---|---|
committer | Griffin Smith <root@gws.fyi> | 2019-07-29T15·22-0400 |
commit | 9db5fad2f900732d59f9714ac4517952d26506d7 (patch) | |
tree | 1f8de240a1f7ccecd37282b0f984e1d0a7d38000 /src/entities/creature.rs | |
parent | 34b20b7786a8f6753bb449425772958e0285c385 (diff) |
Describe what you see when you walk over it
If the character walks over any number of entities, describe those entities to the character.
Diffstat (limited to 'src/entities/creature.rs')
-rw-r--r-- | src/entities/creature.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/entities/creature.rs b/src/entities/creature.rs index 9fd8d23c752e..4cf6f60bdc6c 100644 --- a/src/entities/creature.rs +++ b/src/entities/creature.rs @@ -1,7 +1,7 @@ use crate::display; use crate::entities::raws::CreatureType; use crate::entities::raws::EntityRaw; -use crate::entities::{raw, EntityID}; +use crate::entities::{raw, Describe, EntityID}; use crate::types::Position; use std::io::{self, Write}; @@ -50,6 +50,12 @@ impl Creature { entity!(Creature); +impl Describe for Creature { + fn description(&self) -> String { + self.typ.description.to_string() + } +} + impl display::Draw for Creature { fn do_draw(&self, out: &mut Write) -> io::Result<()> { write!(out, "{}", self.typ.chr) |