about summary refs log tree commit diff
path: root/src/entities/mod.rs
blob: c4f46bf4a723898d068c8a324cd149a4d28d9927 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
pub mod character;
pub mod creature;
pub mod entity_char;
pub mod raws;

pub use character::Character;
pub use creature::Creature;
pub use entity_char::EntityChar;
pub use raws::raw;

use crate::display::Draw;
use crate::types::{Positioned, PositionedMut};
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)
    }
}