OpenTTD Source
20241108-master-g80f628063a
|
Command definitions related to orders. More...
Go to the source code of this file.
Functions | |
CommandCost | CmdModifyOrder (DoCommandFlag flags, VehicleID veh, VehicleOrderID sel_ord, ModifyOrderFlags mof, uint16_t data) |
Modify an order in the orderlist of a vehicle. More... | |
CommandCost | CmdSkipToOrder (DoCommandFlag flags, VehicleID veh_id, VehicleOrderID sel_ord) |
Goto order of order-list. More... | |
CommandCost | CmdDeleteOrder (DoCommandFlag flags, VehicleID veh_id, VehicleOrderID sel_ord) |
Delete an order from the orderlist of a vehicle. More... | |
CommandCost | CmdInsertOrder (DoCommandFlag flags, VehicleID veh, VehicleOrderID sel_ord, const Order &new_order) |
Add an order to the orderlist of a vehicle. More... | |
CommandCost | CmdOrderRefit (DoCommandFlag flags, VehicleID veh, VehicleOrderID order_number, CargoID cargo) |
Add/remove refit orders from an order. More... | |
CommandCost | CmdCloneOrder (DoCommandFlag flags, CloneOptions action, VehicleID veh_dst, VehicleID veh_src) |
Clone/share/copy an order-list of another vehicle. More... | |
CommandCost | CmdMoveOrder (DoCommandFlag flags, VehicleID veh, VehicleOrderID moving_order, VehicleOrderID target_order) |
Move an order inside the orderlist. More... | |
CommandCost | CmdClearOrderBackup (DoCommandFlag flags, TileIndex tile, ClientID user_id) |
Clear an OrderBackup. More... | |
template<typename Tcont , typename Titer > | |
EndianBufferWriter< Tcont, Titer > & | operator<< (EndianBufferWriter< Tcont, Titer > &buffer, const Order &order) |
EndianBufferReader & | operator>> (EndianBufferReader &buffer, Order &order) |
Command definitions related to orders.
Definition in file order_cmd.h.
CommandCost CmdClearOrderBackup | ( | DoCommandFlag | flags, |
TileIndex | tile, | ||
ClientID | user_id | ||
) |
Clear an OrderBackup.
flags | For command. |
tile | Tile related to the to-be-cleared OrderBackup. |
user_id | User that had the OrderBackup. |
Definition at line 154 of file order_backup.cpp.
References DC_EXEC, INVALID_TILE, and OrderBackup::ResetOfUser().
CommandCost CmdCloneOrder | ( | DoCommandFlag | flags, |
CloneOptions | action, | ||
VehicleID | veh_dst, | ||
VehicleID | veh_src | ||
) |
Clone/share/copy an order-list of another vehicle.
flags | operation to perform |
action | action to perform |
veh_dst | destination vehicle to clone orders to |
veh_src | source vehicle to clone orders from, if any (none for CO_UNSHARE) |
Definition at line 1522 of file order_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 CmdDeleteOrder | ( | DoCommandFlag | flags, |
VehicleID | veh_id, | ||
VehicleOrderID | sel_ord | ||
) |
Delete an order from the orderlist of a vehicle.
flags | operation to perform |
veh_id | the ID of the vehicle |
sel_ord | the order to delete (max 255) |
Definition at line 999 of file order_cmd.cpp.
References CheckOwnership(), CMD_ERROR, DC_EXEC, DecloneOrder(), DeleteOrder(), CommandCost::Failed(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_vehicle_pool >::GetIfValid(), Vehicle::GetNumOrders(), Vehicle::GetOrder(), Vehicle::IsPrimaryVehicle(), and Vehicle::owner.
CommandCost CmdInsertOrder | ( | DoCommandFlag | flags, |
VehicleID | veh, | ||
VehicleOrderID | sel_ord, | ||
const Order & | new_order | ||
) |
Add an order to the orderlist of a vehicle.
flags | operation to perform |
veh | ID of the vehicle |
sel_ord | the selected order (if any). If the last order is given, the order will be inserted before that one the maximum vehicle order id is 254. |
new_order | order to insert |
Definition at line 697 of file order_cmd.cpp.
References CARGO_NO_REFIT, CheckOwnership(), CMD_ERROR, CommandCost::Failed(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_vehicle_pool >::GetIfValid(), Order::GetMaxSpeed(), Order::GetRefitCargo(), Order::GetTravelTime(), Order::GetType(), Order::GetWaitTime(), Vehicle::IsPrimaryVehicle(), and Vehicle::owner.
CommandCost CmdModifyOrder | ( | DoCommandFlag | flags, |
VehicleID | veh, | ||
VehicleOrderID | sel_ord, | ||
ModifyOrderFlags | mof, | ||
uint16_t | data | ||
) |
Modify an order in the orderlist of a vehicle.
flags | operation to perform |
veh | ID of the vehicle |
sel_ord | the selected order (if any). If the last order is given, the order will be inserted before that one the maximum vehicle order id is 254. |
mof | what data to modify ( |
data | the data to modify |
Definition at line 1237 of file order_cmd.cpp.
CommandCost CmdMoveOrder | ( | DoCommandFlag | flags, |
VehicleID | veh, | ||
VehicleOrderID | moving_order, | ||
VehicleOrderID | target_order | ||
) |
Move an order inside the orderlist.
flags | operation to perform |
veh | the ID of the vehicle |
moving_order | the order to move |
target_order | the target order |
Definition at line 1139 of file order_cmd.cpp.
References CheckOwnership(), CMD_ERROR, BaseConsist::cur_implicit_order_index, BaseConsist::cur_real_order_index, DC_EXEC, DeleteOrderWarnings(), CommandCost::Failed(), Vehicle::FirstShared(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_vehicle_pool >::GetIfValid(), Vehicle::GetNumOrders(), Vehicle::GetOrder(), InvalidateVehicleOrder(), Vehicle::IsPrimaryVehicle(), OrderList::MoveOrder(), Vehicle::NextShared(), Vehicle::orders, Vehicle::Orders(), Vehicle::owner, and BaseConsist::ResetDepotUnbunching().
CommandCost CmdOrderRefit | ( | DoCommandFlag | flags, |
VehicleID | veh, | ||
VehicleOrderID | order_number, | ||
CargoID | cargo | ||
) |
Add/remove refit orders from an order.
flags | operation to perform |
veh | VehicleIndex of the vehicle having the order |
order_number | number of order to modify |
cargo | CargoID |
Definition at line 1664 of file order_cmd.cpp.
References CARGO_AUTO_REFIT, CARGO_NO_REFIT, 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(), NUM_CARGO, and Vehicle::owner.
CommandCost CmdSkipToOrder | ( | DoCommandFlag | flags, |
VehicleID | veh_id, | ||
VehicleOrderID | sel_ord | ||
) |
Goto order of order-list.
flags | operation to perform |
veh_id | The ID of the vehicle which order is skipped |
sel_ord | the selected order to which we want to skip |
Definition at line 1101 of file order_cmd.cpp.
References CheckOwnership(), CMD_ERROR, BaseConsist::cur_implicit_order_index, Vehicle::current_order, DC_EXEC, CommandCost::Failed(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_vehicle_pool >::GetIfValid(), Vehicle::GetNumOrders(), Vehicle::IsPrimaryVehicle(), Order::IsType(), and Vehicle::owner.