Use built-in constants for tick values#649
Merged
Conversation
I've replaced a few of the constant values (that I could catch) used in the mod with references to the in-game constants. I've done this primarily to make the intentions behind those values clearer. Using `GenTicks.TicksPerRealSecond` is more obvious that the value refers to amount of ticks in a second, rather than just using the value of `60`. Likewise, using `GenDate.TicksPerDay` is much easier to understand than a value of `60000`, or even `2500 * 24`. The only "change" on top is changing `1 / 60f` to `1f / GenTicks.TicksPerRealSecond`, as we need one of those values to be a float (or we'll end up with integer division). This will not change anything gameplay-wise, as all those constants will be computet at compile time and end up the same in the compiled code. This will only affect the source code.
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.
I've replaced a few of the constant values (that I could catch) used in the mod with references to the in-game constants.
I've done this primarily to make the intentions behind those values clearer. Using
GenTicks.TicksPerRealSecondis more obvious that the value refers to amount of ticks in a second, rather than just using the value of60. Likewise, usingGenDate.TicksPerDayis much easier to understand than a value of60000or2500 * 24.The only "change" on top is changing
1 / 60fto1f / GenTicks.TicksPerRealSecond(1to1f), as we need one of those values to be a float (or we'll end up with integer division).This will not change anything gameplay-wise, as all those constants will be computed at compile time and end up the same in the compiled code. This will only affect the source code.