OpenTTD Source: ReplaceChainItem Struct Reference

OpenTTD Source 15.0-RC2

Public Member Functions | Data Fields
ReplaceChainItem Struct Reference

Struct for recording vehicle chain replacement information. More...

## Public Member Functions
| ReplaceChainItem (Vehicle *old_veh, Vehicle *new_veh, Money cost)
| Cost of buying and refitting replacement.
Vehicle * | GetVehicle () const
| Get vehicle to use for this position.

## Data Fields
Vehicle * | old_veh
| Old vehicle to replace.
Vehicle * | new_veh
| Replacement vehicle, or nullptr if no replacement.
Money | cost

## Detailed Description

Struct for recording vehicle chain replacement information.

Definition at line 503 of file autoreplace_cmd.cpp.

## Constructor & Destructor Documentation

## ◆ ReplaceChainItem()

ReplaceChainItem::ReplaceChainItem | ( | Vehicle * | old_veh,
|  | Vehicle * | new_veh,
|  | Money | cost
| ) |  |
| inline

Cost of buying and refitting replacement.

Definition at line 508 of file autoreplace_cmd.cpp.

## Member Function Documentation

## ◆ GetVehicle()

Vehicle * ReplaceChainItem::GetVehicle | ( |  | ) | const
| inline

Get vehicle to use for this position.

Returns
  Either the new vehicle, or the old vehicle if there is no replacement.

Definition at line 514 of file autoreplace_cmd.cpp.

References new_veh, and old_veh.

## Field Documentation

## ◆ cost

Money ReplaceChainItem::cost

Definition at line 506 of file autoreplace_cmd.cpp.

## ◆ new_veh

Vehicle* ReplaceChainItem::new_veh

Replacement vehicle, or nullptr if no replacement.

Definition at line 505 of file autoreplace_cmd.cpp.

Referenced by GetVehicle(), and ReplaceChain().

## ◆ old_veh

Vehicle* ReplaceChainItem::old_veh

Old vehicle to replace.

Definition at line 504 of file autoreplace_cmd.cpp.

Referenced by GetVehicle(), and ReplaceChain().

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

- src/autoreplace_cmd.cpp