about summary refs log tree commit diff
path: root/src/entities/item.rs
diff options
context:
space:
mode:
authorGriffin Smith <root@gws.fyi>2019-07-29T15·22-0400
committerGriffin Smith <root@gws.fyi>2019-07-29T15·22-0400
commit9db5fad2f900732d59f9714ac4517952d26506d7 (patch)
tree1f8de240a1f7ccecd37282b0f984e1d0a7d38000 /src/entities/item.rs
parent34b20b7786a8f6753bb449425772958e0285c385 (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/item.rs')
-rw-r--r--src/entities/item.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/entities/item.rs b/src/entities/item.rs
index d0ecc090e2e4..6e47a87f5b83 100644
--- a/src/entities/item.rs
+++ b/src/entities/item.rs
@@ -1,6 +1,6 @@
 use crate::display;
 use crate::entities::raws::{raw, EntityRaw, ItemType};
-use crate::entities::EntityID;
+use crate::entities::{Describe, EntityID};
 use crate::types::Position;
 use std::io::{self, Write};
 
@@ -37,6 +37,12 @@ impl Item {
 
 entity!(Item);
 
+impl Describe for Item {
+    fn description(&self) -> String {
+        self.typ.description.to_string()
+    }
+}
+
 impl display::Draw for Item {
     fn do_draw(&self, out: &mut Write) -> io::Result<()> {
         write!(out, "{}", self.typ.chr)