OpenTTD Source 20260531-master-g0e951f3528
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::MoveToAction::Deliver, VehicleCargoList::MoveToAction::Transfer > (uint max_move)
 Reassign cargo from MoveToAction::Deliver to MoveToAction::Transfer and take care of the next station the cargo wants to visit.
template uint VehicleCargoList::Reassign< VehicleCargoList::MoveToAction::Deliver, VehicleCargoList::MoveToAction::Keep > (uint)
 Moves some cargo from one designation to another.

Variables

CargoPacketPool _cargopacket_pool ("CargoPacket")

Detailed Description

Implementation of the cargo packets.

Definition in file cargopacket.cpp.

Function Documentation

◆ VehicleCargoList::Reassign< VehicleCargoList::MoveToAction::Deliver, VehicleCargoList::MoveToAction::Keep >()

template uint VehicleCargoList::Reassign< VehicleCargoList::MoveToAction::Deliver, VehicleCargoList::MoveToAction::Keep > ( uint )

Moves some cargo from one designation to another.

Returns
Amount of cargo actually reassigned.

References VehicleCargoList::Reassign().

◆ VehicleCargoList::Reassign< VehicleCargoList::MoveToAction::Deliver, VehicleCargoList::MoveToAction::Transfer >()

template<>
uint VehicleCargoList::Reassign< VehicleCargoList::MoveToAction::Deliver, VehicleCargoList::MoveToAction::Transfer > ( uint max_move)

Reassign cargo from MoveToAction::Deliver to MoveToAction::Transfer and take care of the next station the cargo wants to visit.

Parameters
max_moveMaximum amount of cargo to reassign.
Returns
Amount of cargo actually reassigned.

Definition at line 572 of file cargopacket.cpp.

References CargoPacket::Count(), CargoPacket::next_hop, VehicleCargoList::Reassign(), and CargoPacket::Split().