OpenTTD Source: src/timetable_cmd.h Source File

OpenTTD Source 15.3

timetable_cmd.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_CMD_H
11#define TIMETABLE_CMD_H
12
13#include "command_type.h"
14#include "order_type.h"
15#include "timer/timer_game_tick.h"
16#include "vehicle_type.h"
17
18 CommandCost CmdChangeTimetable(DoCommandFlags flags, VehicleID veh, VehicleOrderID order_number, ModifyTimetableFlags mtf, uint16_t data);
19 CommandCost CmdBulkChangeTimetable(DoCommandFlags flags, VehicleID veh, ModifyTimetableFlags mtf, uint16_t data);
20 CommandCost CmdSetVehicleOnTime(DoCommandFlags flags, VehicleID veh, bool apply_to_group);
21 CommandCost CmdAutofillTimetable(DoCommandFlags flags, VehicleID veh, bool autofill, bool preserve_wait_time);
22 CommandCost CmdSetTimetableStart(DoCommandFlags flags, VehicleID veh_id, bool timetable_all, TimerGameTick::TickCounter start_tick);
23
24DEF_CMD_TRAIT(CMD_CHANGE_TIMETABLE, CmdChangeTimetable, {}, CommandType::RouteManagement)
25DEF_CMD_TRAIT(CMD_BULK_CHANGE_TIMETABLE, CmdBulkChangeTimetable, {}, CommandType::RouteManagement)
26DEF_CMD_TRAIT(CMD_SET_VEHICLE_ON_TIME, CmdSetVehicleOnTime, {}, CommandType::RouteManagement)
27DEF_CMD_TRAIT(CMD_AUTOFILL_TIMETABLE, CmdAutofillTimetable, {}, CommandType::RouteManagement)
28DEF_CMD_TRAIT(CMD_SET_TIMETABLE_START, CmdSetTimetableStart, {}, CommandType::RouteManagement)
29
30#endif /* TIMETABLE_CMD_H */
CommandCost
Common return value for all commands.
Definition command_type.h:24
EnumBitSet
Enum-as-bit-set wrapper.
Definition enum_type.hpp:177
TimerGameTick::TickCounter
uint64_t TickCounter
The type that the tick counter is stored in.
Definition timer_game_tick.h:25
command_type.h
Types related to commands.
CommandType::RouteManagement
@ RouteManagement
Modifications to route management (orders, groups, etc).
CMD_SET_TIMETABLE_START
@ CMD_SET_TIMETABLE_START
set the date that a timetable should start
Definition command_type.h:368
CMD_SET_VEHICLE_ON_TIME
@ CMD_SET_VEHICLE_ON_TIME
set the vehicle on time feature (timetable)
Definition command_type.h:366
CMD_CHANGE_TIMETABLE
@ CMD_CHANGE_TIMETABLE
change the timetable for a vehicle
Definition command_type.h:364
CMD_AUTOFILL_TIMETABLE
@ CMD_AUTOFILL_TIMETABLE
autofill the timetable
Definition command_type.h:367
CMD_BULK_CHANGE_TIMETABLE
@ CMD_BULK_CHANGE_TIMETABLE
change the timetable for all orders of a vehicle
Definition command_type.h:365
order_type.h
Types related to orders.
VehicleOrderID
uint8_t VehicleOrderID
The index of an order within its current vehicle (not pool related)
Definition order_type.h:18
ModifyTimetableFlags
ModifyTimetableFlags
Enumeration for the data to set in CmdChangeTimetable.
Definition order_type.h:186
PoolID< uint32_t, struct VehicleIDTag, 0xFF000, 0xFFFFF >
timer_game_tick.h
Definition of the tick-based game-timer.
CmdSetVehicleOnTime
CommandCost CmdSetVehicleOnTime(DoCommandFlags flags, VehicleID veh, bool apply_to_group)
Clear the lateness counter to make the vehicle on time.
Definition timetable_cmd.cpp:259
CmdAutofillTimetable
CommandCost CmdAutofillTimetable(DoCommandFlags flags, VehicleID veh, bool autofill, bool preserve_wait_time)
Start or stop filling the timetable automatically from the time the vehicle actually takes to complet...
Definition timetable_cmd.cpp:425
CmdSetTimetableStart
CommandCost CmdSetTimetableStart(DoCommandFlags flags, VehicleID veh_id, bool timetable_all, TimerGameTick::TickCounter start_tick)
Set the start date of the timetable.
Definition timetable_cmd.cpp:351
CmdBulkChangeTimetable
CommandCost CmdBulkChangeTimetable(DoCommandFlags flags, VehicleID veh, ModifyTimetableFlags mtf, uint16_t data)
Change timetable data of all orders of a vehicle.
Definition timetable_cmd.cpp:228
CmdChangeTimetable
CommandCost CmdChangeTimetable(DoCommandFlags flags, VehicleID veh, VehicleOrderID order_number, ModifyTimetableFlags mtf, uint16_t data)
Change timetable data of an order.
Definition timetable_cmd.cpp:133
vehicle_type.h
Types related to vehicles.