-
Notifications
You must be signed in to change notification settings - Fork 85
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
#438 Speedlimit refactor #475
Conversation
@dymanoid i hope |
You only need the A struct with a single |
…short) for convenience
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested in game last night and everything seemed to be working fine.
LGTM! 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Fixes #438 - by Victor
SpeedLimitManager
SpeedLimitsTool
?)EnumerateSpeedLimits
,ToMphPreciseString
,ToKmphPreciseString
,ToMphRounded
,ToMphPrecise
,ToKmphPrecise
,ToKmphRounded
,GetPrevious
,GetNext
,GetVerticalTextureScale
to a UI related class (SpeedLimitsTool
?)NearlyEqual
andIsZero
to a (new?) utility class, e.g.FloatUtils
IsValidRange
toSpeedLimitManager
VehicleBehaviorManager.FindBestLane()
such that the variableoptImprovementSpeed
stores velocitiy in game units (and not in km/h).MinMinSafeSpeedImprovement
andMaxMinSafeSpeedImprovement
inDynamicLaneSelection
such that they hold velocities in game units (and not in km/h).velocity
(float) andunit
(SpeedUnit
) to theSpeedLimit
struct and update UI code to use it properly (as a composite value). If not required, remove the struct entirely.Introduces new struct SpeedValue which contains game speed float, and can do conversions with Velocity magnitudes (8x the game speed) and Mph / Kmph. It can potentially replace float everywhere in the game logic but it spreads like a plague, once you replace something, the compiler will complain until everything became the new data type. Worth only if there is no performance loss, and i am not sure about Mono 2.0.