rescope game::inv_for_ functions #36016
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
SUMMARY: Infrastructure "rescope and refactor game::inv_for functions"
Purpose of change
This is part of the work on the nested container project, at least incidentally. Part of this is to change these functions to deal with item_locations as much as possible rather than indices, and to move them out of the
game
class.Describe the solution
Describe alternatives you've considered
Testing
no observable issues with some light testing. tested with throwing, changing sides. possible to test with some of the other iuse actions, but as they use the same functions i didn't think it was necessary.
Additional context
I decided that the "filter by flag" and "filter by itype" functions were a bit superfluous, as it's basically just a specialized filter function anyway, and a lambda for a simple flag filter is simple enough.
I could bring those back if desired, but they were only used for maybe 2 or 3 instances each