OpenTTD
Public Member Functions | Data Fields
VehicleListIdentifier Struct Reference

The information about a vehicle list. More...

#include <vehiclelist.h>

Public Member Functions

uint32 Pack () const
 Pack a VehicleListIdentifier in a single uint32.
bool Unpack (uint32 data)
 Unpack a VehicleListIdentifier from a single uint32.
 VehicleListIdentifier (VehicleListType type, VehicleType vtype, CompanyID company, uint index=0)
 Create a simple vehicle list.
 VehicleListIdentifier (uint32 data=0)
 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 index
 A vehicle list type specific index.

Detailed Description

The information about a vehicle list.

Definition at line 31 of file vehiclelist.h.

Constructor & Destructor Documentation

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::VehicleListIdentifier ( uint32  data = 0)

Decode a packed vehicle list identifier into a new one.

Parameters
dataThe data to unpack.

Definition at line 55 of file vehiclelist.cpp.

References Unpack().

Member Function Documentation

uint32 VehicleListIdentifier::Pack ( ) const
bool VehicleListIdentifier::Unpack ( uint32  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 CmdMassStartStopVehicle(), CmdSendVehicleToDepot(), and VehicleListIdentifier().


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