OpenTTD Source 20241224-master-gf74b0cf984
VehicleListIdentifier Struct Reference

The information about a vehicle list. More...

#include <vehiclelist.h>

Public Member Functions

uint32_t Pack () const
 Pack a VehicleListIdentifier in a single uint32.
 
bool UnpackIfValid (uint32_t data)
 Unpack a VehicleListIdentifier from a single uint32.
 
bool Valid () const
 
 VehicleListIdentifier (VehicleListType type, VehicleType vtype, CompanyID company, uint index=0)
 Create a simple vehicle list.
 

Static Public Member Functions

static VehicleListIdentifier UnPack (uint32_t data)
 Decode a packed vehicle list identifier into a new one.
 

Data Fields

VehicleListType type
 The type of vehicle list.
 
VehicleType vtype
 The vehicle type associated with this list.
 
CompanyID company
 The company associated with this list.
 
uint32_t index
 A vehicle list type specific index.
 

Detailed Description

The information about a vehicle list.

Definition at line 28 of file vehiclelist.h.

Constructor & Destructor Documentation

◆ VehicleListIdentifier() [1/2]

VehicleListIdentifier::VehicleListIdentifier ( VehicleListType  type,
VehicleType  vtype,
CompanyID  company,
uint  index = 0 
)
inline

Create a simple vehicle list.

Parameters
typeList type.
vtypeVehicle type associated with this list.
companyCompany associated with this list.
indexOptional type specific index.

Definition at line 47 of file vehiclelist.h.

◆ VehicleListIdentifier() [2/2]

VehicleListIdentifier::VehicleListIdentifier ( )
inline

Definition at line 50 of file vehiclelist.h.

Member Function Documentation

◆ Pack()

uint32_t VehicleListIdentifier::Pack ( ) const

◆ UnPack()

VehicleListIdentifier VehicleListIdentifier::UnPack ( uint32_t  data)
static

Decode a packed vehicle list identifier into a new one.

Parameters
dataThe data to unpack.

Definition at line 55 of file vehiclelist.cpp.

References UnpackIfValid().

Referenced by VehicleListWindow::OnClick().

◆ UnpackIfValid()

bool VehicleListIdentifier::UnpackIfValid ( uint32_t  data)

Unpack a VehicleListIdentifier from a single uint32.

Parameters
dataThe data to unpack.
Returns
true iff the data was valid (enough).

Definition at line 40 of file vehiclelist.cpp.

References company, GB(), index, OWNER_NONE, type, and vtype.

Referenced by UnPack().

◆ Valid()

bool VehicleListIdentifier::Valid ( ) const
inline

Definition at line 38 of file vehiclelist.h.

Field Documentation

◆ company

◆ index

◆ type

◆ vtype


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