diff --git a/src/lib.rs b/src/lib.rs index 9afd193..b27060e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -5,7 +5,7 @@ mod colour; mod config; mod entity; mod image; -mod mock; +pub mod mock; mod music; mod palette; mod scene; @@ -224,10 +224,9 @@ impl Game { Ok(Game { config, images, tiles, palettes, music, entities, scenes }) } - // todo Result<&Image>? - pub fn get_image_by_name(&self, name: String) -> Option<&Image> { + pub fn get_image_by_name(&self, name: &String) -> Option<&Image> { for image in self.images.iter() { - if image.name == name { + if &image.name == name { return Some(&image); } }