OpenTTD Source: CargoReturn Class Reference

OpenTTD Source 14.1

Public Member Functions | Protected Attributes
CargoReturn Class Reference

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

`#include <cargoaction.h>`

Inheritance diagram for CargoReturn:

## Public Member Functions
| CargoReturn (VehicleCargoList *source, StationCargoList *destination, uint max_move, StationID next, TileIndex current_tile)
bool | operator() (CargoPacket *cp)
| Returns some reserved cargo. 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...

## Protected Attributes
TileIndex | current_tile
| Current tile cargo unloading is happening.
StationID | next
Protected Attributes inherited from CargoMovement< VehicleCargoList, StationCargoList >
VehicleCargoList * | source
| Source of the cargo.
StationCargoList * | 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< VehicleCargoList, StationCargoList >
CargoPacket * | Preprocess (CargoPacket *cp)
| Decides if a packet needs to be split. More...

## Detailed Description

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

Definition at line 100 of file cargoaction.h.

## Member Function Documentation

## ◆ operator()()

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

Returns some reserved cargo.

Parameters

  cp | Packet 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 StationCargoList::Append(), CargoPacket::Count(), current_tile, CargoMovement< VehicleCargoList, StationCargoList >::destination, CargoList< VehicleCargoList, CargoPacketList >::MTA_LOAD, CargoMovement< VehicleCargoList, StationCargoList >::Preprocess(), VehicleCargoList::RemoveFromMeta(), StationCargoList::reserved_count, CargoMovement< VehicleCargoList, StationCargoList >::source, and CargoPacket::UpdateUnloadingTile().

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

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