pub mod avatar; pub mod colour; pub mod dialogue; pub mod ending; pub mod exit; pub mod game; pub mod palette; pub mod image; pub mod item; pub mod mock; pub mod position; pub mod room; pub mod sprite; pub mod tile; pub mod variable; use avatar::Avatar; use colour::Colour; use dialogue::Dialogue; use ending::Ending; use exit::Exit; use game::Game; use palette::Palette; use image::Image; use item::Item; use position::Position; use room::Room; use sprite::Sprite; use tile::Tile; use variable::Variable; #[derive(Debug, Eq, PartialEq)] pub struct Instance { position: Position, id: String, // item / ending.rs id } #[derive(Debug, Eq, PartialEq)] pub struct ExitInstance { position: Position, exit: Exit, } pub trait AnimationFrames { fn to_string(&self) -> String; } impl AnimationFrames for Vec { #[inline] fn to_string(&self) -> String { let mut string = String::new(); let last_frame = self.len() - 1; for (i, frame) in self.into_iter().enumerate() { string.push_str(&frame.to_string()); if i < last_frame { string.push_str(&"\n>\n".to_string()); } } string } }