about summary refs log tree commit diff
path: root/src/entities/mod.rs
blob: a23b15eef34c42ce2af3fc076cafde07544de835 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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)
    }
}