|
OpenTTD Source
13.2.1
|
#include "command_type.h"Go to the source code of this file.
Functions | |
| CommandCost | CmdChangeTimetable (DoCommandFlag flags, VehicleID veh, VehicleOrderID order_number, ModifyTimetableFlags mtf, uint16 data) |
| Change timetable data of an order. More... | |
| CommandCost | CmdBulkChangeTimetable (DoCommandFlag flags, VehicleID veh, ModifyTimetableFlags mtf, uint16 data) |
| Change timetable data of all orders of a vehicle. More... | |
| CommandCost | CmdSetVehicleOnTime (DoCommandFlag flags, VehicleID veh) |
| Clear the lateness counter to make the vehicle on time. More... | |
| CommandCost | CmdAutofillTimetable (DoCommandFlag flags, VehicleID veh, bool autofill, bool preserve_wait_time) |
| Start or stop filling the timetable automatically from the time the vehicle actually takes to complete it. More... | |
| CommandCost | CmdSetTimetableStart (DoCommandFlag flags, VehicleID veh_id, bool timetable_all, Date start_date) |
| Set the start date of the timetable. More... | |
Command definitions related to timetables.
Definition in file timetable_cmd.h.
| CommandCost CmdAutofillTimetable | ( | DoCommandFlag | flags, |
| VehicleID | veh, | ||
| bool | autofill, | ||
| bool | preserve_wait_time | ||
| ) |
Start or stop filling the timetable automatically from the time the vehicle actually takes to complete it.
When starting to autofill the current times are cleared and the timetable will start again from scratch.
| flags | Operation to perform. |
| veh | Vehicle index. |
| autofill | Enable or disable autofill |
| preserve_wait_time | Set to preserve waiting times in non-destructive mode |
Definition at line 339 of file timetable_cmd.cpp.
References CheckOwnership(), ClrBit(), CMD_ERROR, DC_EXEC, CommandCost::Failed(), Vehicle::FirstShared(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_vehicle_pool >::GetIfValid(), Vehicle::IsPrimaryVehicle(), BaseConsist::lateness_counter, Vehicle::NextShared(), Vehicle::orders, Vehicle::owner, SetBit(), SetWindowDirty(), BaseConsist::timetable_start, BaseConsist::vehicle_flags, VF_AUTOFILL_PRES_WAIT_TIME, VF_AUTOFILL_TIMETABLE, VF_TIMETABLE_STARTED, and WC_VEHICLE_TIMETABLE.
| CommandCost CmdBulkChangeTimetable | ( | DoCommandFlag | flags, |
| VehicleID | veh, | ||
| ModifyTimetableFlags | mtf, | ||
| uint16 | data | ||
| ) |
Change timetable data of all orders of a vehicle.
| flags | Operation to perform. |
| veh | Vehicle with the orders to change. |
| mtf | Timetable data to change ( |
| data | The data to modify as specified by mtf. 0 to clear times, UINT16_MAX to clear speed limit. |
Definition at line 185 of file timetable_cmd.cpp.
References CheckOwnership(), CMD_ERROR, CommandCost::Failed(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_vehicle_pool >::GetIfValid(), Vehicle::IsPrimaryVehicle(), and Vehicle::owner.
| CommandCost CmdChangeTimetable | ( | DoCommandFlag | flags, |
| VehicleID | veh, | ||
| VehicleOrderID | order_number, | ||
| ModifyTimetableFlags | mtf, | ||
| uint16 | data | ||
| ) |
Change timetable data of an order.
| flags | Operation to perform. |
| veh | Vehicle with the orders to change. |
| order_number | Order index to modify. |
| mtf | Timetable data to change ( |
| data | The data to modify as specified by mtf. 0 to clear times, UINT16_MAX to clear speed limit. |
Definition at line 96 of file timetable_cmd.cpp.
References CheckOwnership(), CMD_ERROR, CommandCost::Failed(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_vehicle_pool >::GetIfValid(), Vehicle::GetOrder(), Vehicle::IsPrimaryVehicle(), Order::IsType(), and Vehicle::owner.
| CommandCost CmdSetTimetableStart | ( | DoCommandFlag | flags, |
| VehicleID | veh_id, | ||
| bool | timetable_all, | ||
| Date | start_date | ||
| ) |
Set the start date of the timetable.
| flags | Operation to perform. |
| veh_id | Vehicle ID. |
| timetable_all | Set to set timetable start for all vehicles sharing this order |
| start_date | The timetable start date. |
Definition at line 277 of file timetable_cmd.cpp.
References _date, CheckOwnership(), CMD_ERROR, DAY_TICKS, DAYS_IN_LEAP_YEAR, DC_EXEC, CommandCost::Failed(), OrderList::GetFirstSharedVehicle(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_vehicle_pool >::GetIfValid(), OrderList::GetTimetableTotalDuration(), OrderList::IsCompleteTimetable(), Vehicle::IsPrimaryVehicle(), MAX_DAY, Vehicle::NextShared(), Vehicle::orders, and Vehicle::owner.
| CommandCost CmdSetVehicleOnTime | ( | DoCommandFlag | flags, |
| VehicleID | veh | ||
| ) |
Clear the lateness counter to make the vehicle on time.
| flags | Operation to perform. |
| veh | Vehicle with the orders to change. |
Definition at line 215 of file timetable_cmd.cpp.
References CheckOwnership(), CMD_ERROR, DC_EXEC, CommandCost::Failed(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_vehicle_pool >::GetIfValid(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index, Vehicle::IsPrimaryVehicle(), BaseConsist::lateness_counter, Vehicle::orders, Vehicle::owner, SetWindowDirty(), and WC_VEHICLE_TIMETABLE.