diff --git a/src/mock.rs b/src/mock.rs index f49a494..b3021f1 100644 --- a/src/mock.rs +++ b/src/mock.rs @@ -1,4 +1,4 @@ -pub(crate) mod image { +pub mod image { use crate::image::Image; pub fn _bg() -> Image { @@ -66,7 +66,7 @@ pub(crate) mod image { } } -pub(crate) mod palette { +pub mod palette { use crate::{Palette, Colour}; pub(crate) fn default() -> Palette { @@ -80,7 +80,7 @@ pub(crate) mod palette { } } - pub(crate) fn soup11() -> Palette { + pub fn soup11() -> Palette { Palette { name: "soup11".into(), colours: vec![ @@ -100,10 +100,10 @@ pub(crate) mod palette { } } -pub(crate) mod scenes { +pub mod scenes { use crate::Scene; - pub(crate) fn zero() -> Scene { + pub fn zero() -> Scene { Scene { name: "zero".into(), background: vec![ @@ -145,3 +145,65 @@ pub(crate) mod scenes { } } } + +pub mod entities { + use crate::Entity; + + pub fn bitsy_avatar() -> Entity { + Entity { + name: "".to_string(), + image: "avatar".to_string(), + tags: vec!["player".into()] + } + } + + pub fn bitsy_cat() -> Entity { + Entity { + name: "cat".to_string(), + image: "cat".to_string(), + tags: vec![] + } + } +} + +pub mod tiles { + use crate::Tile; + + pub fn bitsy_block() -> Tile { + Tile { + name: "block".into(), + images: vec!["block".into()], + wall: false + } + } +} + +pub mod game { + use crate::{Config, Game}; + + pub fn bitsy() -> Game { + Game { + config: Config { + name: Some("Write your game's title here".into()), + width: 16, + height: 16, + tick: 400, + starting_room: None, + version: (0, 1) + }, + entities: vec![ + crate::mock::entities::bitsy_avatar(), + crate::mock::entities::bitsy_cat(), + ], + images: vec![], + palettes: vec![], + scenes: vec![ + crate::mock::scenes::zero(), + ], + tiles: vec![ + crate::mock::tiles::bitsy_block(), + ], + music: vec![] + } + } +}