OpenTTD

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- Data Structures
- Class Hierarchy
- Data Fields

Public Member Functions
CargoShift Class Reference

Action of shifting cargo from one vehicle to another. More...

`#include <cargoaction.h>`

Inheritance diagram for CargoShift:

## Public Member Functions
| CargoShift (VehicleCargoList *source, VehicleCargoList *destination, uint max_move)
bool | operator() (CargoPacket *cp)
| Shifts some cargo from a vehicle to another one.
Public Member Functions inherited from CargoMovement< VehicleCargoList, VehicleCargoList >
| CargoMovement (VehicleCargoList *source, VehicleCargoList *destination, uint max_move)
uint | MaxMove ()
| Returns how much more cargo can be moved with this action.

## Additional Inherited Members
Protected Member Functions inherited from CargoMovement< VehicleCargoList, VehicleCargoList >
CargoPacket * | Preprocess (CargoPacket *cp)
Protected Attributes inherited from CargoMovement< VehicleCargoList, VehicleCargoList >
VehicleCargoList * | source
| Source of the cargo.
VehicleCargoList * | destination
| Destination for the cargo.
uint | max_move
| Maximum amount of cargo to be moved with this action.

## Detailed Description

Action of shifting cargo from one vehicle to another.

Definition at line 108 of file cargoaction.h.

## Member Function Documentation

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

Shifts some cargo from a vehicle to another one.

Parameters

  cp | Packet to be shifted.

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

Definition at line 183 of file cargoaction.cpp.

References VehicleCargoList::Append(), CargoPacket::Count(), CargoMovement< VehicleCargoList, VehicleCargoList >::destination, CargoList< VehicleCargoList, CargoPacketList >::MTA_KEEP, CargoMovement< VehicleCargoList, VehicleCargoList >::Preprocess(), VehicleCargoList::RemoveFromMeta(), and CargoMovement< VehicleCargoList, VehicleCargoList >::source.

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

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