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

rescope game::inv_for_ functions #36016

Merged
merged 2 commits into from
Dec 17, 2019

Conversation

KorGgenT
Copy link
Member

@KorGgenT KorGgenT commented Dec 11, 2019

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

  • rescope the functions
  • rework the functions to return item_location
  • examine function names and functionality to determine their usage and whether they're really just a slightly different flavor of other functions such as common()

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

@KorGgenT KorGgenT added Inventory / AIM / Zones Inventory, Advanced Inventory Management or Zones [C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style 0.E Feature Freeze labels Dec 11, 2019
- moved scope from game:: to game_menus::inv
- added avatar parameter
- return item_location instead of index
- adjust function calls as necessary
- rename inv_for_all to titled_menu
- rescope to game_menus::inv::
- rename function to titled_filter_menu
- remove superfluous functions in favor of generic filter function
- fix function calls
- return item_location instead of int pos
- add avatar parameter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style Inventory / AIM / Zones Inventory, Advanced Inventory Management or Zones
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants