OpenTTD Source 20260531-master-g0e951f3528
CargoReturn Class Reference

Action of returning previously reserved cargo from the vehicle to the station. More...

#include <cargoaction.h>

Inheritance diagram for CargoReturn:
CargoMovement< VehicleCargoList, StationCargoList >

Public Member Functions

 CargoReturn (VehicleCargoList *source, StationCargoList *destination, uint max_move, StationID next, TileIndex current_tile)
bool operator() (CargoPacket *cp)
 Returns some reserved cargo.
Public Member Functions inherited from CargoMovement< VehicleCargoList, StationCargoList >
 CargoMovement (VehicleCargoList *source, StationCargoList *destination, uint max_move)
 Create the movement.
uint MaxMove ()
 Returns how much more cargo can be moved with this action.

Protected Attributes

TileIndex current_tile
 Current tile cargo unloading is happening.
StationID next
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.

Additional Inherited Members

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

Detailed Description

Action of returning previously reserved cargo from the vehicle to the station.

Definition at line 120 of file cargoaction.h.

Constructor & Destructor Documentation

◆ CargoReturn()

CargoReturn::CargoReturn ( VehicleCargoList * source,
StationCargoList * destination,
uint max_move,
StationID next,
TileIndex current_tile )
inline

Definition at line 125 of file cargoaction.h.

Member Function Documentation

◆ operator()()

bool CargoReturn::operator() ( CargoPacket * cp)

Returns some reserved cargo.

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

Definition at line 150 of file cargoaction.cpp.

References CargoPacket::Count(), current_tile, CargoMovement< VehicleCargoList, StationCargoList >::destination, CargoMovement< VehicleCargoList, StationCargoList >::Preprocess(), CargoMovement< VehicleCargoList, StationCargoList >::source, and CargoPacket::UpdateUnloadingTile().

Field Documentation

◆ current_tile

TileIndex CargoReturn::current_tile
protected

Current tile cargo unloading is happening.

Definition at line 122 of file cargoaction.h.

Referenced by operator()().

◆ next

StationID CargoReturn::next
protected

Definition at line 123 of file cargoaction.h.


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