OpenTTD Source: VehicleCargoReroute Class Reference

OpenTTD Source 12.0-beta1

Public Member Functions
VehicleCargoReroute Class Reference

Action of rerouting cargo staged for transfer in a vehicle. More...

`#include <cargoaction.h>`

Inheritance diagram for VehicleCargoReroute:

## 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. More...
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< VehicleCargoList, VehicleCargoList >
| CargoMovement (VehicleCargoList *source, VehicleCargoList *destination, uint max_move)
uint | MaxMove ()
| Returns how much more cargo can be moved with this action. More...

## Additional Inherited Members
Protected Member Functions inherited from CargoMovement< VehicleCargoList, VehicleCargoList >
CargoPacket * | Preprocess (CargoPacket *cp)
| Decides if a packet needs to be split. More...
Protected Attributes inherited from CargoReroute< VehicleCargoList >
StationID | avoid
StationID | avoid2
const GoodsEntry * | ge
Protected Attributes inherited from CargoMovement< VehicleCargoList, VehicleCargoList >
VehicleCargoList * | source
| Source of the cargo.
VehicleCargoList * | destination
| Destination for the cargo.
uint | max_move
| Maximum amount of cargo to be moved with this action.

## Detailed Description

Action of rerouting cargo staged for transfer in a vehicle.

Definition at line 134 of file cargoaction.h.

## Member Function Documentation

## ◆ operator()()

bool VehicleCargoReroute::operator() | ( | CargoPacket * | cp | ) |

Reroutes some cargo in a VehicleCargoList.

Parameters

  cp | Packet to be rerouted.

Returns
  True if the packet was completely rerouted, false if part of it was.

Definition at line 218 of file cargoaction.cpp.

References VehicleCargoList::AddToMeta(), CargoPacket::Count(), CargoMovement< VehicleCargoList, VehicleCargoList >::destination, GoodsEntry::GetVia(), CargoList< VehicleCargoList, CargoPacketList >::MTA_TRANSFER, CargoPacket::NextStation(), CargoList< Tinst, Tcont >::packets, CargoMovement< VehicleCargoList, VehicleCargoList >::Preprocess(), VehicleCargoList::RemoveFromMeta(), CargoPacket::SetNextStation(), CargoMovement< VehicleCargoList, VehicleCargoList >::source, and CargoPacket::SourceStation().

The documentation for this class was generated from the following files:

- src/cargoaction.h
- src/cargoaction.cpp