OpenTTD Source 20241224-master-gee860a5c8e
|
Action of rerouting cargo staged for transfer in a vehicle. More...
#include <cargoaction.h>
Public Member Functions | |
VehicleCargoReroute (VehicleCargoList *source, VehicleCargoList *dest, uint max_move, StationID avoid, StationID avoid2, const GoodsEntry *ge) | |
bool | operator() (CargoPacket *cp) |
Reroutes some cargo in a VehicleCargoList. | |
Public Member Functions inherited from CargoReroute< VehicleCargoList > | |
CargoReroute (VehicleCargoList *source, VehicleCargoList *dest, uint max_move, StationID avoid, StationID avoid2, const GoodsEntry *ge) | |
Public Member Functions inherited from CargoMovement< Tsource, Tdest > | |
CargoMovement (Tsource *source, Tdest *destination, uint max_move) | |
uint | MaxMove () |
Returns how much more cargo can be moved with this action. | |
Additional Inherited Members | |
Protected Member Functions inherited from CargoMovement< Tsource, Tdest > | |
CargoPacket * | Preprocess (CargoPacket *cp) |
Decides if a packet needs to be split. | |
Protected Attributes inherited from CargoReroute< VehicleCargoList > | |
StationID | avoid |
StationID | avoid2 |
const GoodsEntry * | ge |
Protected Attributes inherited from CargoMovement< Tsource, Tdest > | |
Tsource * | source |
Source of the cargo. | |
Tdest * | destination |
Destination for the cargo. | |
uint | max_move |
Maximum amount of cargo to be moved with this action. | |
Action of rerouting cargo staged for transfer in a vehicle.
Definition at line 140 of file cargoaction.h.
|
inline |
Definition at line 142 of file cargoaction.h.
bool VehicleCargoReroute::operator() | ( | CargoPacket * | cp | ) |
Reroutes some cargo in a VehicleCargoList.
cp | Packet to be rerouted. |
Definition at line 220 of file cargoaction.cpp.
References CargoPacket::Count(), CargoMovement< Tsource, Tdest >::destination, CargoPacket::GetFirstStation(), CargoPacket::GetNextHop(), GoodsEntry::GetVia(), CargoList< VehicleCargoList, CargoPacketList >::MTA_TRANSFER, CargoMovement< Tsource, Tdest >::Preprocess(), CargoPacket::SetNextHop(), and CargoMovement< Tsource, Tdest >::source.