misc
This commit is contained in:
parent
1f231a8434
commit
2349d7365e
|
@ -5,7 +5,7 @@ mod colour;
|
||||||
mod config;
|
mod config;
|
||||||
mod entity;
|
mod entity;
|
||||||
mod image;
|
mod image;
|
||||||
mod mock;
|
pub mod mock;
|
||||||
mod music;
|
mod music;
|
||||||
mod palette;
|
mod palette;
|
||||||
mod scene;
|
mod scene;
|
||||||
|
@ -224,10 +224,9 @@ impl Game {
|
||||||
Ok(Game { config, images, tiles, palettes, music, entities, scenes })
|
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() {
|
for image in self.images.iter() {
|
||||||
if image.name == name {
|
if &image.name == name {
|
||||||
return Some(&image);
|
return Some(&image);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue