about summary refs log tree commit diff
path: root/src/entities/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/entities/mod.rs')
-rw-r--r--src/entities/mod.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/entities/mod.rs b/src/entities/mod.rs
index 0320f2ddd9c1..a23b15eef34c 100644
--- a/src/entities/mod.rs
+++ b/src/entities/mod.rs
@@ -1,2 +1,16 @@
 pub mod character;
+use crate::display::Draw;
+use crate::types::{Positioned, PositionedMut};
 pub use character::Character;
+use downcast_rs::Downcast;
+use std::io::{self, Write};
+
+pub trait Entity: Positioned + PositionedMut + Draw + Downcast {}
+
+impl_downcast!(Entity);
+
+impl Draw for Box<dyn Entity> {
+    fn do_draw(&self, out: &mut Write) -> io::Result<()> {
+        (**self).do_draw(out)
+    }
+}