OpenTTD Source 20260108-master-g8ba1860eaa
FinalizeRefitAction Struct Reference

Action for finalizing a refit. More...

Public Member Functions

 FinalizeRefitAction (CargoArray &consist_capleft, Station *st, std::span< const StationID > next_station, bool do_reserve)
 Create a finalizing action.
 
bool operator() (Vehicle *v)
 Reserve cargo from the station and update the remaining consist capacities with the vehicle's remaining free capacity.
 

Data Fields

CargoArrayconsist_capleft
 Capacities left in the consist.
 
Stationst
 Station to reserve cargo from.
 
std::span< const StationIDnext_station
 Next hops to reserve cargo for.
 
bool do_reserve
 If the vehicle should reserve.
 

Detailed Description

Action for finalizing a refit.

Definition at line 1426 of file economy.cpp.

Constructor & Destructor Documentation

◆ FinalizeRefitAction()

FinalizeRefitAction::FinalizeRefitAction ( CargoArray consist_capleft,
Station st,
std::span< const StationID next_station,
bool  do_reserve 
)
inline

Create a finalizing action.

Parameters
consist_capleftCapacities left in the consist.
stStation to reserve cargo from.
next_stationNext hops to reserve cargo for.
do_reserveIf we should reserve cargo or just add up the capacities.

Definition at line 1440 of file economy.cpp.

Member Function Documentation

◆ operator()()

bool FinalizeRefitAction::operator() ( Vehicle v)
inline

Reserve cargo from the station and update the remaining consist capacities with the vehicle's remaining free capacity.

Parameters
vVehicle to be finalized.
Returns
true.

Definition at line 1449 of file economy.cpp.

References Vehicle::cargo, Vehicle::cargo_cap, Vehicle::cargo_type, Station::goods, and VehicleCargoList::RemainingCount().

Field Documentation

◆ consist_capleft

CargoArray& FinalizeRefitAction::consist_capleft

Capacities left in the consist.

Definition at line 1428 of file economy.cpp.

◆ do_reserve

bool FinalizeRefitAction::do_reserve

If the vehicle should reserve.

Definition at line 1431 of file economy.cpp.

◆ next_station

std::span<const StationID> FinalizeRefitAction::next_station

Next hops to reserve cargo for.

Definition at line 1430 of file economy.cpp.

◆ st

Station* FinalizeRefitAction::st

Station to reserve cargo from.

Definition at line 1429 of file economy.cpp.


The documentation for this struct was generated from the following file: