MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / GetTimetableParameters

Function GetTimetableParameters

src/timetable_gui.cpp:50–59  ·  view source on GitHub ↗

* Get parameters to format timetable time. * @param ticks Number of ticks to format. * @returns Pair of parameters to format timetable time. */

Source from the content-addressed store, hash-verified

48 * @returns Pair of parameters to format timetable time.
49 */
50std::pair<StringParameter, StringParameter> GetTimetableParameters(TimerGameTick::Ticks ticks)
51{
52 switch (_settings_client.gui.timetable_mode) {
53 case TimetableMode::Days: return {STR_UNITS_DAYS, ticks / Ticks::DAY_TICKS};
54 case TimetableMode::Seconds: return {STR_UNITS_SECONDS, ticks / Ticks::TICKS_PER_SECOND};
55 case TimetableMode::Ticks: return {STR_UNITS_TICKS, ticks};
56 default:
57 NOT_REACHED();
58 }
59}
60
61/**
62 * Get the number of ticks in the current timetable display unit.

Callers 4

DrawOrderStringFunction · 0.85
DrawSummaryPanelMethod · 0.85

Calls 1

NOT_REACHEDFunction · 0.85

Tested by

no test coverage detected