OpenTTD: src/cargopacket.cpp File Reference

OpenTTD

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

- File List
- Globals

Functions | Variables
cargopacket.cpp File Reference

Implementation of the cargo packets. More...

`#include "stdafx.h"`
`#include "station_base.h"`
`#include "core/pool_func.hpp"`
`#include "core/random_func.hpp"`
`#include "economy_base.h"`
`#include "cargoaction.h"`
`#include "order_type.h"`
`#include "safeguards.h"`

Go to the source code of this file.

## Functions
template<>
uint | VehicleCargoList::Reassign< VehicleCargoList::MTA_DELIVER, VehicleCargoList::MTA_TRANSFER > (uint max_move, TileOrStationID next_station)
| Reassign cargo from MTA_DELIVER to MTA_TRANSFER and take care of the next station the cargo wants to visit.
template uint | VehicleCargoList::Reassign< VehicleCargoList::MTA_DELIVER, VehicleCargoList::MTA_KEEP > (uint, TileOrStationID)

## Variables
CargoPacketPool | _cargopacket_pool ("CargoPacket")
| The actual pool with cargo packets.

## Detailed Description

Implementation of the cargo packets.

Definition in file cargopacket.cpp.

## Function Documentation

template<>

uint VehicleCargoList::Reassign< VehicleCargoList::MTA_DELIVER, VehicleCargoList::MTA_TRANSFER > | ( | uint | max_move,
|  | TileOrStationID | next_station
| ) |  |

Reassign cargo from MTA_DELIVER to MTA_TRANSFER and take care of the next station the cargo wants to visit.

Parameters

  max_move | Maximum amount of cargo to reassign.
  next_station | Station to record as next hop in the reassigned packets.

Returns
  Amount of cargo actually reassigned.

Definition at line 579 of file cargopacket.cpp.

References CargoPacket::Count(), min(), CargoPacket::next_station, and CargoPacket::Split().

## Variable Documentation

CargoPacketPool _cargopacket_pool("CargoPacket")

The actual pool with cargo packets.