diff options
| author | troido <troido@protonmail.com> | 2020-09-22 15:36:58 +0200 |
|---|---|---|
| committer | troido <troido@protonmail.com> | 2020-09-22 15:36:58 +0200 |
| commit | 37ad98cf725aa22f1c793b66102c99c9a76a4ec2 (patch) | |
| tree | a1f35b025abb36b48c7646e84af76c05fcfac3cf /src/components/inventory.rs | |
| parent | 33c1054d528efd896415baf08d4a52e1cdd7b801 (diff) | |
can base sprite on equipped items
Diffstat (limited to 'src/components/inventory.rs')
| -rw-r--r-- | src/components/inventory.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/components/inventory.rs b/src/components/inventory.rs index fa65b03..dc308bf 100644 --- a/src/components/inventory.rs +++ b/src/components/inventory.rs @@ -5,7 +5,8 @@ use crate::{ ItemId, item::{Item, ItemAction}, components::equipment::{Stat, Equippable}, - Encyclopedia + Encyclopedia, + Sprite }; #[derive(Debug, Clone)] @@ -58,4 +59,8 @@ impl Inventory { } bonuses } + + pub fn equipment_sprites(&self) -> Vec<Sprite> { + self.equipped().iter().filter_map(|e| e.sprite.clone()).collect() + } } |
