snix/src/entities/mod.rs
Griffin Smith e7ad87c730 Add (statically-included) entity raws
Add a system for statically-included entity raws (which necessitated
making a deserializable existential Color struct) and test it out by
initializing the game (for now) with a single on-screen gormlak.
2019-07-14 14:29:55 -04:00

24 lines
534 B
Rust

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)
}
}