Implement extremely basic combat
There's a gormlak, you can kill it. That's it.
This commit is contained in:
parent
e7ad87c730
commit
575a051e6e
9 changed files with 220 additions and 48 deletions
|
|
@ -1,3 +1,5 @@
|
|||
#[macro_use]
|
||||
pub mod entity;
|
||||
pub mod character;
|
||||
pub mod creature;
|
||||
pub mod entity_char;
|
||||
|
|
@ -5,20 +7,8 @@ pub mod raws;
|
|||
|
||||
pub use character::Character;
|
||||
pub use creature::Creature;
|
||||
pub use entity::{Entity, Identified};
|
||||
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)
|
||||
}
|
||||
}
|
||||
pub type EntityID = u32;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue