OpenTTD Source: CargoDelivery Class Reference

OpenTTD Source 12.2

Public Member Functions | Protected Attributes
CargoDelivery Class Reference

Action of final delivery of cargo. More...

`#include <cargoaction.h>`

Inheritance diagram for CargoDelivery:

## Public Member Functions
| CargoDelivery (VehicleCargoList *source, uint max_move, CargoPayment *payment)
bool | operator() (CargoPacket *cp)
| Delivers some cargo. More...
Public Member Functions inherited from CargoRemoval< VehicleCargoList >
| CargoRemoval (VehicleCargoList *source, uint max_move)
uint | MaxMove ()
| Returns how much more cargo can be removed with this action. More...
bool | operator() (CargoPacket *cp)
bool | operator() (CargoPacket *cp)
| Removes some cargo from a StationCargoList. More...

## Protected Attributes
CargoPayment * | payment
| Payment object where payments will be registered.
Protected Attributes inherited from CargoRemoval< VehicleCargoList >
VehicleCargoList * | source
| Source of the cargo.
uint | max_move
| Maximum amount of cargo to be removed with this action.

## Additional Inherited Members
Protected Member Functions inherited from CargoRemoval< VehicleCargoList >
uint | Preprocess (CargoPacket *cp)
| Determines the amount of cargo to be removed from a packet and removes that from the metadata of the list. More...
bool | Postprocess (CargoPacket *cp, uint remove)
| Finalize cargo removal. More...

## Detailed Description

Action of final delivery of cargo.

Definition at line 39 of file cargoaction.h.

## Member Function Documentation

## ◆ operator()()

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

Delivers some cargo.

Parameters

  cp | Packet to be delivered.

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

Definition at line 106 of file cargoaction.cpp.

References CargoList< VehicleCargoList, CargoPacketList >::MTA_DELIVER, CargoPayment::PayFinalDelivery(), payment, CargoRemoval< VehicleCargoList >::Postprocess(), CargoRemoval< VehicleCargoList >::Preprocess(), VehicleCargoList::RemoveFromMeta(), and CargoRemoval< VehicleCargoList >::source.

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

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