OpenTTD Source 20241224-master-gf74b0cf984
PrepareRefitAction Struct Reference

Refit preparation action. More...

Public Member Functions

 PrepareRefitAction (CargoArray &consist_capleft, CargoTypes &refit_mask)
 Create a refit preparation action.
 
bool operator() (const Vehicle *v)
 Prepares for refitting of a vehicle, subtracting its free capacity from consist_capleft and adding the cargoes it can refit to to the refit mask.
 

Data Fields

CargoArrayconsist_capleft
 Capacities left in the consist.
 
CargoTypes & refit_mask
 Bitmask of possible refit cargoes.
 

Detailed Description

Refit preparation action.

Definition at line 1398 of file economy.cpp.

Constructor & Destructor Documentation

◆ PrepareRefitAction()

PrepareRefitAction::PrepareRefitAction ( CargoArray consist_capleft,
CargoTypes &  refit_mask 
)
inline

Create a refit preparation action.

Parameters
consist_capleftCapacities left in consist, to be updated here.
refit_maskRefit mask to be constructed from refit information of vehicles.

Definition at line 1408 of file economy.cpp.

Member Function Documentation

◆ operator()()

bool PrepareRefitAction::operator() ( const Vehicle v)
inline

Prepares for refitting of a vehicle, subtracting its free capacity from consist_capleft and adding the cargoes it can refit to to the refit mask.

Parameters
vThe vehicle to be refitted.
Returns
true.

Definition at line 1417 of file economy.cpp.

References Vehicle::cargo, Vehicle::cargo_cap, Vehicle::cargo_type, Vehicle::engine_type, and VehicleCargoList::ReservedCount().

Field Documentation

◆ consist_capleft

CargoArray& PrepareRefitAction::consist_capleft

Capacities left in the consist.

Definition at line 1400 of file economy.cpp.

◆ refit_mask

CargoTypes& PrepareRefitAction::refit_mask

Bitmask of possible refit cargoes.

Definition at line 1401 of file economy.cpp.


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