OpenTTD Source: src/timetable.h Source File

OpenTTD Source 15.3

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 <https://www.gnu.org/licenses/old-licenses/gpl-2.0>.
6 */
7
10#ifndef TIMETABLE_H
11#define TIMETABLE_H
12
13#include "strings_type.h"
14#include "timer/timer_game_tick.h"
15#include "timer/timer_game_economy.h"
16#include "vehicle_type.h"
17
18 static const TimerGameEconomy::Year MAX_TIMETABLE_START_YEARS{15};
19
20enum class TimetableMode : uint8_t {
21 Days,
22 Seconds,
23 Ticks,
24};
25
26 TimerGameTick::TickCounter GetStartTickFromDate(TimerGameEconomy::Date start_date);
27 TimerGameEconomy::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 */
Ticks
Storage class for Ticks constants.
Definition timer_game_tick.h:66
TimerGameTick::TickCounter
uint64_t TickCounter
The type that the tick counter is stored in.
Definition timer_game_tick.h:25
TimerGameTick::Ticks
int32_t Ticks
The type to store ticks in.
Definition timer_game_tick.h:24
strings_type.h
Types related to strings.
StrongType::Typedef
Templated helper to make a type-safe 'typedef' representing a single POD value.
Definition strong_typedef_type.hpp:130
Vehicle
Vehicle data structure.
Definition vehicle_base.h:205
timer_game_economy.h
Definition of the game-economy-timer.
timer_game_tick.h
Definition of the tick-based game-timer.
ShowTimetableWindow
void ShowTimetableWindow(const Vehicle *v)
Show the timetable for a given vehicle.
Definition timetable_gui.cpp:856
UpdateVehicleTimetable
void UpdateVehicleTimetable(Vehicle *v, bool travelling)
Update the timetable for the vehicle.
Definition timetable_cmd.cpp:469
GetTimetableParameters
std::pair< StringParameter, StringParameter > GetTimetableParameters(TimerGameTick::Ticks ticks)
Get parameters to format timetable time.
Definition timetable_gui.cpp:50
MAX_TIMETABLE_START_YEARS
static const TimerGameEconomy::Year MAX_TIMETABLE_START_YEARS
The maximum start date offset, in economy years.
Definition timetable.h:18
GetStartTickFromDate
TimerGameTick::TickCounter GetStartTickFromDate(TimerGameEconomy::Date start_date)
Get the TimerGameTick::TickCounter tick of a given date.
Definition timetable_cmd.cpp:29
GetDateFromStartTick
TimerGameEconomy::Date GetDateFromStartTick(TimerGameTick::TickCounter start_tick)
Get a date from a given start tick of timetable.
Definition timetable_cmd.cpp:46
vehicle_type.h
Types related to vehicles.