Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add a find helper method to PlayerInventories #897

Merged
merged 1 commit into from
Jan 11, 2024

Conversation

nelson137
Copy link
Contributor

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.

Copy link
Member

@zicklag zicklag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@zicklag zicklag added this pull request to the merge queue Jan 11, 2024
Merged via the queue into fishfolk:main with commit 4f01e5c Jan 11, 2024
8 checks passed
@nelson137 nelson137 deleted the player-inv-helper branch January 11, 2024 22:30
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants