OpenTTD Source 20260414-master-g8a7bc482ad
CargoReroute< Tlist > Class Template Reference

Action of rerouting cargo between different cargo lists and/or next hops. More...

#include <cargoaction.h>

Inheritance diagram for CargoReroute< Tlist >:
CargoMovement< Tlist, Tlist >

Public Member Functions

 CargoReroute (Tlist *source, Tlist *dest, uint max_move, StationID avoid, StationID avoid2, const GoodsEntry *ge)
 Create the movement.
Public Member Functions inherited from CargoMovement< Tlist, Tlist >
 CargoMovement (Tlist *source, Tlist *destination, uint max_move)
 Create the movement.
uint MaxMove ()
 Returns how much more cargo can be moved with this action.

Protected Attributes

StationID avoid
 First station to avoid during rerouting.
StationID avoid2
 Second station to avoid during rerouting, could be StationID::Invalid().
const GoodsEntryge
 Goods that are to be rerouted.
Protected Attributes inherited from CargoMovement< Tlist, Tlist >
Tlist * source
 Source of the cargo.
Tlist * destination
 Destination for the cargo.
uint max_move
 Maximum amount of cargo to be moved with this action.

Additional Inherited Members

Protected Member Functions inherited from CargoMovement< Tlist, Tlist >
CargoPacketPreprocess (CargoPacket *cp)
 Decides if a packet needs to be split.

Detailed Description

template<class Tlist>
class CargoReroute< Tlist >

Action of rerouting cargo between different cargo lists and/or next hops.

Definition at line 140 of file cargoaction.h.

Constructor & Destructor Documentation

◆ CargoReroute()

template<class Tlist>
CargoReroute< Tlist >::CargoReroute ( Tlist * source,
Tlist * dest,
uint max_move,
StationID avoid,
StationID avoid2,
const GoodsEntry * ge )
inline

Create the movement.

Parameters
sourceThe source of the cargo.
destThe destination of the cargo.
max_moveThe maximum amount of cargo to be moved.
avoidFirst station to avoid.
avoid2Optional second station to avoid (use StationID::Invalid()).
geThe goods to reroute.

Definition at line 155 of file cargoaction.h.

References avoid, avoid2, CargoMovement< Tlist, Tlist >::CargoMovement(), ge, CargoMovement< Tlist, Tlist >::max_move, and CargoMovement< Tlist, Tlist >::source.

Field Documentation

◆ avoid

template<class Tlist>
StationID CargoReroute< Tlist >::avoid
protected

First station to avoid during rerouting.

Definition at line 142 of file cargoaction.h.

Referenced by CargoReroute().

◆ avoid2

template<class Tlist>
StationID CargoReroute< Tlist >::avoid2
protected

Second station to avoid during rerouting, could be StationID::Invalid().

Definition at line 143 of file cargoaction.h.

Referenced by CargoReroute().

◆ ge

template<class Tlist>
const GoodsEntry* CargoReroute< Tlist >::ge
protected

Goods that are to be rerouted.

Definition at line 144 of file cargoaction.h.

Referenced by CargoReroute().


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