OpenTTD Source 20241224-master-gf74b0cf984
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.
 
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
 

Detailed Description

Struct for recording vehicle chain replacement information.

Definition at line 496 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 501 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 507 of file autoreplace_cmd.cpp.

References new_veh, and old_veh.

Field Documentation

◆ cost

Money ReplaceChainItem::cost

Definition at line 499 of file autoreplace_cmd.cpp.

◆ new_veh

Vehicle* ReplaceChainItem::new_veh

Replacement vehicle, or nullptr if no replacement.

Definition at line 498 of file autoreplace_cmd.cpp.

Referenced by GetVehicle(), and ReplaceChain().

◆ old_veh

Vehicle* ReplaceChainItem::old_veh

Old vehicle to replace.

Definition at line 497 of file autoreplace_cmd.cpp.

Referenced by GetVehicle(), and ReplaceChain().


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