OpenTTD Source 20260311-master-g511d3794ce
ReplaceChainItem Struct Reference

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

Public Member Functions

 ReplaceChainItem (Vehicle *old_veh, Vehicle *new_veh, Money cost)
 Create a new item.
VehicleGetVehicle () const
 Get vehicle to use for this position.

Data Fields

Vehicleold_veh
 Old vehicle to replace.
Vehiclenew_veh
 Replacement vehicle, or nullptr if no replacement.
Money cost
 Cost of buying and refitting replacement.

Detailed Description

Struct for recording vehicle chain replacement information.

Definition at line 504 of file autoreplace_cmd.cpp.

Constructor & Destructor Documentation

◆ ReplaceChainItem()

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

Create a new item.

Parameters
old_vehThe vehicle to replace.
new_vehThe replacement vehicle, maybe be nullptr if there is no replacement.
costThe cost for buying/refitting.

Definition at line 515 of file autoreplace_cmd.cpp.

References cost, new_veh, and old_veh.

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 521 of file autoreplace_cmd.cpp.

References new_veh, and old_veh.

Field Documentation

◆ cost

Money ReplaceChainItem::cost

Cost of buying and refitting replacement.

Definition at line 507 of file autoreplace_cmd.cpp.

Referenced by ReplaceChain(), and ReplaceChainItem().

◆ new_veh

Vehicle* ReplaceChainItem::new_veh

Replacement vehicle, or nullptr if no replacement.

Definition at line 506 of file autoreplace_cmd.cpp.

Referenced by GetVehicle(), ReplaceChain(), and ReplaceChainItem().

◆ old_veh

Vehicle* ReplaceChainItem::old_veh

Old vehicle to replace.

Definition at line 505 of file autoreplace_cmd.cpp.

Referenced by GetVehicle(), ReplaceChain(), and ReplaceChainItem().


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