fishfolk / jumpy

Tactical 2D shooter in fishy pixels style. Made with Rust-lang 🦀 and Bevy 🪶
https://fishfolk.org/games/jumpy/
Other
1.64k stars 118 forks source link

feat: Add a find helper method to `PlayerInventories` #897

Closed nelson137 closed 8 months ago

nelson137 commented 8 months ago

I noticed that in many places in the codebase, it's necessary to find the inventory that contains some item (usually to get the player entity), if any exists, from the PlayerInventories system param. This simply adds a helper method find_item that does the .iter().find_map(...) that is duplicated in many places.

There is also some minor cleanup regarding ComponentStore::remove.