diff options
Diffstat (limited to 'src/tileset.rs')
-rw-r--r-- | src/tileset.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/tileset.rs b/src/tileset.rs index df7045d..0595186 100644 --- a/src/tileset.rs +++ b/src/tileset.rs @@ -74,6 +74,15 @@ impl Tileset { *self.tiles.get(&id).unwrap() } + pub fn get_spawn_tiles(&self) -> Vec<(String, usize)> { + self.properties + .clone() + .into_iter() + .filter(|p| p.spawn.is_some()) + .map(|p| (p.spawn.unwrap(), p.tile_id)) + .collect() + } + pub fn get_animation(&self, tile_id: usize) -> Vec<(usize, Rect)> { if let Some(property) = self.properties.iter().find(|p| p.tile_id == tile_id) { self.properties |