OpenTTD

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- Data Structures
- Class Hierarchy
- Data Fields

Public Member Functions | Static 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 | UnpackIfValid (uint32 data)
| Unpack a VehicleListIdentifier from a single uint32.
| VehicleListIdentifier (VehicleListType type, VehicleType vtype, CompanyID company, uint index=0)
| Create a simple vehicle list.

## Static Public Member Functions
static VehicleListIdentifier | UnPack (uint32 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 | 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

  type | List type.
  vtype | Vehicle type associated with this list.
  company | Company associated with this list.
  index | Optional type specific index.

Definition at line 48 of file vehiclelist.h.

## Member Function Documentation

uint32 VehicleListIdentifier::Pack | ( |  | ) | const

Pack a VehicleListIdentifier in a single uint32.

Returns
  The packed identifier.

Definition at line 23 of file vehiclelist.cpp.

References company, index, OWNER_NONE, type, and vtype.

Referenced by CmdAddVehicleGroup(), CmdAlterGroup(), CmdRemoveAllVehiclesGroup(), CmdRenameDepot(), CmdSetGroupReplaceProtection(), VehicleGroupWindow::OnClick(), DepotWindow::OnClick(), VehicleGroupWindow::OnDropdownSelect(), VehicleListWindow::OnInvalidateData(), Vehicle::RemoveFromShared(), and ShowCompanyGroup().

VehicleListIdentifier VehicleListIdentifier::UnPack | ( | uint32 | data | ) |
| static

Decode a packed vehicle list identifier into a new one.

Parameters

  data | The data to unpack.

Definition at line 55 of file vehiclelist.cpp.

References UnpackIfValid().

Referenced by VehicleListWindow::OnClick().

bool VehicleListIdentifier::UnpackIfValid | ( | uint32 | data | ) |

Unpack a VehicleListIdentifier from a single uint32.

Parameters

  data | The 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 UnPack().

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

- src/vehiclelist.h
- src/vehiclelist.cpp