[WIP] Refactor player hardcoded effects and include tests #40270
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 "Refactor player hardcoded effects and include tests"
Purpose of change
To begin some refactoring of
player::hardcoded_effects
and include some test cases.Describe the solution
Adds test cases to
tests/player_effect_test.cpp
and refactors some code insrc/player_hardcoded_effects.cpp
.more to come
Describe alternatives you've considered
The single
hardcoded_effects
function is in dire need of some refactoring, splitting up, and JSONifying (not to mention testing). I expect to tackle testing and some modest refactoring with this PR, but plan to leave more extensive overhaul and conversion to be more data-driven for a later PR.Testing
tests/cata_test [player][effect]
Additional context
This is spin-off part 3 of #40064
WIP since there is considerable work remaining.