OpenTTD

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

- Data Structures
- Class Hierarchy
- Data Fields

Public Member Functions | Data Fields
FinalizeRefitAction Struct Reference

Action for finalizing a refit. More...

## Public Member Functions
| FinalizeRefitAction (CargoArray &consist_capleft, Station *st, StationIDStack &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
CargoArray & | consist_capleft
| Capacities left in the consist.
Station * | st
| Station to reserve cargo from.
StationIDStack & | next_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 1424 of file economy.cpp.

## Constructor & Destructor Documentation

FinalizeRefitAction::FinalizeRefitAction | ( | CargoArray & | consist_capleft,
|  | Station * | st,
|  | StationIDStack & | next_station,
|  | bool | do_reserve
| ) |  |
| inline

Create a finalizing action.

Parameters

  consist_capleft | Capacities left in the consist.
  st | Station to reserve cargo from.
  next_station | Next hops to reserve cargo for.
  do_reserve | If we should reserve cargo or just add up the capacities.

Definition at line 1438 of file economy.cpp.

## Member Function Documentation

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

  v | Vehicle to be finalized.

Returns
  true.

Definition at line 1447 of file economy.cpp.

References Vehicle::cargo, GoodsEntry::cargo, Vehicle::cargo_cap, Vehicle::cargo_type, consist_capleft, do_reserve, Station::goods, next_station, VehicleCargoList::RemainingCount(), StationCargoList::Reserve(), st, and BaseStation::xy.

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

- src/economy.cpp