OpenTTD
Public Member Functions
CargoTransfer Class Reference

Action of transferring cargo from a vehicle to a station. More...

#include <cargoaction.h>

Inheritance diagram for CargoTransfer:
CargoMovement< VehicleCargoList, StationCargoList >

Public Member Functions

 CargoTransfer (VehicleCargoList *source, StationCargoList *destination, uint max_move)
 
bool operator() (CargoPacket *cp)
 Transfers some cargo from a vehicle to a station. More...
 
- Public Member Functions inherited from CargoMovement< VehicleCargoList, StationCargoList >
 CargoMovement (VehicleCargoList *source, StationCargoList *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, StationCargoList >
CargoPacketPreprocess (CargoPacket *cp)
 Decides if a packet needs to be split. More...
 
- Protected Attributes inherited from CargoMovement< VehicleCargoList, StationCargoList >
VehicleCargoListsource
 Source of the cargo.
 
StationCargoListdestination
 Destination for the cargo.
 
uint max_move
 Maximum amount of cargo to be moved with this action.
 

Detailed Description

Action of transferring cargo from a vehicle to a station.

Definition at line 73 of file cargoaction.h.

Member Function Documentation

◆ operator()()

bool CargoTransfer::operator() ( CargoPacket cp)

Transfers some cargo from a vehicle to a station.

Parameters
cpPacket to be transfered.
Returns
True if the packet was completely reserved, false if part of it was.

Definition at line 168 of file cargoaction.cpp.

References CargoPacket::Count(), CargoList< VehicleCargoList, CargoPacketList >::MTA_TRANSFER, CargoPacket::NextStation(), CargoRemoval< Tsource >::Preprocess(), and CargoRemoval< Tsource >::source.


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