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

Function TicksPerTimetableUnit

src/timetable_gui.cpp:65–77  ·  view source on GitHub ↗

* Get the number of ticks in the current timetable display unit. * @return The number of ticks per day, second, or tick, to match the timetable display. */

Source from the content-addressed store, hash-verified

63 * @return The number of ticks per day, second, or tick, to match the timetable display.
64 */
65static inline TimerGameTick::Ticks TicksPerTimetableUnit()
66{
67 switch (_settings_client.gui.timetable_mode) {
68 case TimetableMode::Days:
69 return Ticks::DAY_TICKS;
70 case TimetableMode::Seconds:
71 return Ticks::TICKS_PER_SECOND;
72 case TimetableMode::Ticks:
73 return 1;
74 default:
75 NOT_REACHED();
76 }
77}
78
79/**
80 * Determine if a vehicle should be shown as late or early, using a threshold depending on the timetable display setting.

Callers 3

OnClickMethod · 0.85
OnQueryTextFinishedMethod · 0.85

Calls 1

NOT_REACHEDFunction · 0.85

Tested by

no test coverage detected