OpenTTD
Public Member Functions | Protected Attributes
CargoLoad Class Reference

Action of loading cargo from a station onto a vehicle. More...

#include <cargoaction.h>

Inheritance diagram for CargoLoad:
CargoMovement< StationCargoList, VehicleCargoList > CargoReservation

Public Member Functions

 CargoLoad (StationCargoList *source, VehicleCargoList *destination, uint max_move, TileIndex load_place)
 
bool operator() (CargoPacket *cp)
 Loads some cargo onto a vehicle. More...
 
- Public Member Functions inherited from CargoMovement< StationCargoList, VehicleCargoList >
 CargoMovement (StationCargoList *source, VehicleCargoList *destination, uint max_move)
 
uint MaxMove ()
 Returns how much more cargo can be moved with this action. More...
 

Protected Attributes

TileIndex load_place
 TileIndex to be saved in the packets' loaded_at_xy.
 
- Protected Attributes inherited from CargoMovement< StationCargoList, VehicleCargoList >
StationCargoListsource
 Source of the cargo.
 
VehicleCargoListdestination
 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< StationCargoList, VehicleCargoList >
CargoPacketPreprocess (CargoPacket *cp)
 Decides if a packet needs to be split. More...
 

Detailed Description

Action of loading cargo from a station onto a vehicle.

Definition at line 81 of file cargoaction.h.

Member Function Documentation

◆ operator()()

bool CargoLoad::operator() ( CargoPacket cp)

Loads some cargo onto a vehicle.

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

Definition at line 121 of file cargoaction.cpp.

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


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