mirror of
https://github.com/doukutsu-rs/doukutsu-rs
synced 2024-12-04 19:03:28 +00:00
Compare commits
2 commits
94cb7039a8
...
3c5f5c7496
Author | SHA1 | Date | |
---|---|---|---|
3c5f5c7496 | |||
87591f4a3d |
|
@ -110,6 +110,10 @@ impl Inventory {
|
|||
self.weapons.get(idx)
|
||||
}
|
||||
|
||||
pub fn get_weapon_by_type_mut(&mut self, wtype: WeaponType) -> Option<&mut Weapon> {
|
||||
self.weapons.iter_mut().find(|weapon| weapon.wtype == wtype)
|
||||
}
|
||||
|
||||
pub fn get_current_weapon(&self) -> Option<&Weapon> {
|
||||
self.weapons.get(self.current_weapon as usize)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue