MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / performanceToRating

Function performanceToRating

src/OpenLoco/src/World/Company.cpp:230–233  ·  view source on GitHub ↗

Converts performance index to rating 0x00437D60 input: ax = performanceIndex output: ax = return value, corporate rating

Source from the content-addressed store, hash-verified

228 // output:
229 // ax = return value, corporate rating
230 constexpr CorporateRating performanceToRating(int16_t performanceIndex)
231 {
232 return static_cast<CorporateRating>(std::min(9, performanceIndex / 100));
233 }
234
235 static constexpr auto kRatingNames = Utility::buildLookupTable<CorporateRating, StringId>({
236 { CorporateRating::platelayer, StringIds::corporate_rating_platelayer },

Callers 2

formatPerformanceIndexFunction · 0.85
updateMonthly1Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected