create character_martial_arts class and change scope from player #35038
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 "Changes scope of various martial arts data from player to a new class"
Purpose of change
part of #34721
Describe the solution
I noticed that in
player
there were quite a number of members that were specifically related to martial arts. This gave me the idea to migrate these members into a new class called character_martial_arts that keeps any martialarts data and is used as an interface between a Character and its known martial arts. There were some functions related to martial arts that were actually just checking effects on the Character as well, so they stayed.In addition to changing the scope of some members in player, it was necessary to change parameters of the functions in martialarts.h/cpp to Character instead of player.
Also, whenever i saw an
auto
in a function i touched, i murdered it in cold blood.Describe alternatives you've considered
just moving them to Character
Testing
Loaded up a character pre-change and learned all styles via debug menu.
switched to the branch with the changes, and saw that all of the styles loaded properly (so the save/load migration works)
then save and load again.
Additional context