OpenTTD

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- Data Structures
- Class Hierarchy
- Data Fields

Public Member Functions
StationCargoReroute Class Reference

Action of rerouting cargo in a station. More...

`#include <cargoaction.h>`

Inheritance diagram for StationCargoReroute:

## Public Member Functions
| StationCargoReroute (StationCargoList *source, StationCargoList *dest, uint max_move, StationID avoid, StationID avoid2, const GoodsEntry *ge)
bool | operator() (CargoPacket *cp)
| Reroutes some cargo from one Station sublist to another.
Public Member Functions inherited from CargoReroute< StationCargoList >
| CargoReroute (StationCargoList *source, StationCargoList *dest, uint max_move, StationID avoid, StationID avoid2, const GoodsEntry *ge)
Public Member Functions inherited from CargoMovement< StationCargoList, StationCargoList >
| CargoMovement (StationCargoList *source, StationCargoList *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< StationCargoList, StationCargoList >
CargoPacket * | Preprocess (CargoPacket *cp)
Protected Attributes inherited from CargoReroute< StationCargoList >
StationID | avoid
StationID | avoid2
const GoodsEntry * | ge

## Detailed Description

Action of rerouting cargo in a station.

Definition at line 128 of file cargoaction.h.

## Member Function Documentation

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

Reroutes some cargo from one Station sublist to another.

Parameters

  cp | Packet to be rerouted.

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

Definition at line 197 of file cargoaction.cpp.

References CargoList< Tinst, Tcont >::AddToCache(), CargoPacket::Count(), CargoMovement< StationCargoList, StationCargoList >::destination, GoodsEntry::GetVia(), MultiMap< Tkey, Tvalue, Tcompare >::Insert(), CargoList< Tinst, Tcont >::packets, CargoMovement< StationCargoList, StationCargoList >::Preprocess(), CargoList< Tinst, Tcont >::RemoveFromCache(), CargoMovement< StationCargoList, StationCargoList >::source, and CargoPacket::SourceStation().

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

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