-
Notifications
You must be signed in to change notification settings - Fork 290
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
Character code reorganization 23-jul-2022 #1752
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 "Reorganized some Character-related code"
Purpose of change
Move some code around for the following immediate and long-term goals:
newcharacter.h
/newcharacter.cpp
Character
family methods into namespaced functionsplayer
class for its eventual removalCharacter
instead ofplayer
Character
/map
methods-turned-functions:character_effects.h
- functions for calculating impact on Character's stats/speed/etc.character_display.h
- Character display functionscharacter_encumbrance.h
- Character encumbrance functionscharacter_stat.h
- Character stat enum (and relevant functions in the future)character_functions.h
- miscellaneous Character functionsconsumption.h
- Character consumption functions (rename tocharacter_consumption.h
?)map_functions.h
- miscellaneous map functionsplayer_display.cpp
tocharacter_display.cpp
to matchDescribe the solution
Copy-paste sprinkled with some boilerplate.
Describe alternatives you've considered
map_functions.h
andcharacter_functions.h
are horrible names, but I don't have any better.Also, not sure whether I'm being overzealous with putting them in a separate header instead of settling on a namespace in
map.h
/character.h
.It'd be great to have a dedicated
.cpp
for every.h
added here, but those would negatively impact compilation times due to how much inclusions even the most common headers likecharacter.h
,item.h
,map.h
, etc. pull in.Testing
Game compiles locally, old saves load. Should have no behavior changes.
Additional context
May be easier to review on a per-commit basis.