OpenTTD Source 20250312-master-gcdcc6b491d
timetable.h
Go to the documentation of this file.
1/*
2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
6 */
7
10#ifndef TIMETABLE_H
11#define TIMETABLE_H
12
13#include "strings_type.h"
16#include "vehicle_type.h"
17
18static const TimerGameEconomy::Year MAX_TIMETABLE_START_YEARS{15};
19
20enum class TimetableMode : uint8_t {
21 Days,
22 Seconds,
23 Ticks,
24};
25
26TimerGameTick::TickCounter GetStartTickFromDate(TimerGameEconomy::Date start_date);
27TimerGameEconomy::Date GetDateFromStartTick(TimerGameTick::TickCounter start_tick);
28
29void ShowTimetableWindow(const Vehicle *v);
30void UpdateVehicleTimetable(Vehicle *v, bool travelling);
31
32std::pair<StringParameter, StringParameter> GetTimetableParameters(TimerGameTick::Ticks ticks);
33
34#endif /* TIMETABLE_H */
Storage class for Ticks constants.
uint64_t TickCounter
The type that the tick counter is stored in.
int32_t Ticks
The type to store ticks in.
Types related to strings.
Vehicle data structure.
Definition of the game-economy-timer.
Definition of the tick-based game-timer.
void ShowTimetableWindow(const Vehicle *v)
Show the timetable for a given vehicle.
void UpdateVehicleTimetable(Vehicle *v, bool travelling)
Update the timetable for the vehicle.
std::pair< StringParameter, StringParameter > GetTimetableParameters(TimerGameTick::Ticks ticks)
Get parameters to format timetable time.
static const TimerGameEconomy::Year MAX_TIMETABLE_START_YEARS
The maximum start date offset, in economy years.
Definition timetable.h:18
TimerGameTick::TickCounter GetStartTickFromDate(TimerGameEconomy::Date start_date)
Get the TimerGameTick::TickCounter tick of a given date.
TimerGameEconomy::Date GetDateFromStartTick(TimerGameTick::TickCounter start_tick)
Get a date from a given start tick of timetable.
Types related to vehicles.