* Determine if a vehicle should be shown as late or early, using a threshold depending on the timetable display setting. * @param ticks The number of ticks that the vehicle is late or early. * @param round_to_day When using ticks, if we should round up to the nearest day. * @return True if the vehicle is outside the "on time" threshold, either early or late. */
| 83 | * @return True if the vehicle is outside the "on time" threshold, either early or late. |
| 84 | */ |
| 85 | bool VehicleIsAboveLatenessThreshold(TimerGameTick::Ticks ticks, bool round_to_day) |
| 86 | { |
| 87 | switch (_settings_client.gui.timetable_mode) { |
| 88 | case TimetableMode::Days: |
| 89 | return ticks > Ticks::DAY_TICKS; |
| 90 | case TimetableMode::Seconds: |
| 91 | return ticks > Ticks::TICKS_PER_SECOND; |
| 92 | case TimetableMode::Ticks: |
| 93 | return ticks > (round_to_day ? Ticks::DAY_TICKS : 0); |
| 94 | default: |
| 95 | NOT_REACHED(); |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | /** |
| 100 | * Check whether it is possible to determine how long the order takes. |
no test coverage detected