docs: clean up & document game speed-related code#7136
Open
Bertie690 wants to merge 3 commits intopagefaultgames:betafrom
Open
docs: clean up & document game speed-related code#7136Bertie690 wants to merge 3 commits intopagefaultgames:betafrom
Bertie690 wants to merge 3 commits intopagefaultgames:betafrom
Conversation
This file contains hidden or 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.
What are the changes the user will see?
N/A
Why am I making these changes?
The game speed code was not well documented, and also specified many lengthy types that could (and should) be inferred.
I was particularly motivated by
mutateProperties, which had a parameter type ofanyand a biome ignore that brushed a larger issue aside.What are the changes from a developer perspective?
Added documentation to various functions and methods used by the game speed code, removing type specifications where TS was able to infer them.
Altered
objinsidemutatePropertiesto beobjectfor slightly more safety, and mentioned the fact that the method would be within allowed bounds were it not defined inside theinitGameSpeedfunction.(For those curious, I just added oneline
ifstatements until it started giving errors, since each one is worth 1 point without nesting.)Screenshots/Videos
N/A
How to test the changes?
N/A
Checklist
betaas my base branchbeta,mainor the name of another long-lived feature branchpnpm test:silentto test locally)