OpenTTD Source: VehicleListIdentifier Struct Reference

OpenTTD Source 15.0-RC2

Public Member Functions | Data Fields
VehicleListIdentifier Struct Reference

The information about a vehicle list. More...

`#include <vehiclelist.h>`

## Public Member Functions
WindowNumber | ToWindowNumber () const
| Pack a VehicleListIdentifier in 32 bits so it can be used as unique WindowNumber.
bool | Valid () const
constexpr CompanyID | ToCompanyID () const
constexpr DestinationID | ToDestinationID () const
constexpr GroupID | ToGroupID () const
constexpr StationID | ToStationID () const
constexpr VehicleID | ToVehicleID () const
constexpr void | SetIndex (uint32_t index)
constexpr void | SetIndex (ConvertibleThroughBase auto index)
| VehicleListIdentifier (VehicleListType type, VehicleType vtype, CompanyID company, uint index=0)
| Create a simple vehicle list.
| VehicleListIdentifier (VehicleListType type, VehicleType vtype, CompanyID company, ConvertibleThroughBase auto index)

## 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 32 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

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

Definition at line 58 of file vehiclelist.h.

## ◆ VehicleListIdentifier() [2/2]

VehicleListIdentifier::VehicleListIdentifier | ( | VehicleListType | type,
|  | VehicleType | vtype,
|  | CompanyID | company,
|  | ConvertibleThroughBase auto | index
| ) |  |
| inline

Definition at line 61 of file vehiclelist.h.

## Member Function Documentation

## ◆ SetIndex() [1/2]

constexpr void VehicleListIdentifier::SetIndex | ( | ConvertibleThroughBase auto | index | ) |
| inlineconstexpr

Definition at line 49 of file vehiclelist.h.

## ◆ SetIndex() [2/2]

constexpr void VehicleListIdentifier::SetIndex | ( | uint32_t | index | ) |
| inlineconstexpr

Definition at line 48 of file vehiclelist.h.

## ◆ ToCompanyID()

constexpr CompanyID VehicleListIdentifier::ToCompanyID | ( |  | ) | const
| inlineconstexpr

Definition at line 42 of file vehiclelist.h.

## ◆ ToDestinationID()

constexpr DestinationID VehicleListIdentifier::ToDestinationID | ( |  | ) | const
| inlineconstexpr

Definition at line 43 of file vehiclelist.h.

## ◆ ToGroupID()

constexpr GroupID VehicleListIdentifier::ToGroupID | ( |  | ) | const
| inlineconstexpr

Definition at line 44 of file vehiclelist.h.

## ◆ ToStationID()

constexpr StationID VehicleListIdentifier::ToStationID | ( |  | ) | const
| inlineconstexpr

Definition at line 45 of file vehiclelist.h.

## ◆ ToVehicleID()

constexpr VehicleID VehicleListIdentifier::ToVehicleID | ( |  | ) | const
| inlineconstexpr

Definition at line 46 of file vehiclelist.h.

## ◆ ToWindowNumber()

WindowNumber VehicleListIdentifier::ToWindowNumber | ( |  | ) | const

Pack a VehicleListIdentifier in 32 bits so it can be used as unique WindowNumber.

Returns
  The window number.

Definition at line 23 of file vehiclelist.cpp.

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

Referenced by CmdAlterGroup(), CmdRemoveAllVehiclesGroup(), CmdRenameDepot(), CmdSetGroupFlag(), VehicleListWindow::OnInvalidateData(), Vehicle::RemoveFromShared(), and ShowCompanyGroupInternal().

## ◆ Valid()

bool VehicleListIdentifier::Valid | ( |  | ) | const
| inline

Definition at line 40 of file vehiclelist.h.

## Field Documentation

## ◆ company

CompanyID VehicleListIdentifier::company

The company associated with this list.

Definition at line 35 of file vehiclelist.h.

Referenced by VehicleGroupWindow::ComputeGroupInfoSize(), VehicleGroupWindow::DrawGroupInfo(), GenerateVehicleSortList(), VehicleGroupWindow::GetGroupProfitSpriteID(), VehicleGroupWindow::GetWidgetString(), VehicleGroupWindow::OnPaint(), and ToWindowNumber().

## ◆ index

uint32_t VehicleListIdentifier::index

A vehicle list type specific index.

Definition at line 36 of file vehiclelist.h.

Referenced by ToWindowNumber().

## ◆ type

VehicleListType VehicleListIdentifier::type

The type of vehicle list.

Definition at line 33 of file vehiclelist.h.

Referenced by GenerateVehicleSortList(), VehicleListWindow::GetWidgetString(), VehicleListWindow::OnClick(), VehicleListWindow::OnGameTick(), VehicleListWindow::OnInvalidateData(), VehicleListWindow::OnPaint(), ToWindowNumber(), and VehicleListWindow::UpdateWidgetSize().

## ◆ vtype

VehicleType VehicleListIdentifier::vtype

The vehicle type associated with this list.

Definition at line 34 of file vehiclelist.h.

Referenced by BaseVehicleListWindow::BuildActionDropdownList(), VehicleGroupWindow::BuildGroupList(), CmdMassStartStopVehicle(), VehicleGroupWindow::ComputeGroupInfoSize(), BaseVehicleListWindow::DrawVehicleListItems(), GenerateVehicleSortList(), BaseVehicleListWindow::GetActionDropdownSize(), VehicleGroupWindow::GetGroupNameString(), VehicleGroupWindow::GetWidgetString(), VehicleListWindow::GetWidgetString(), VehicleGroupWindow::OnClick(), VehicleListWindow::OnClick(), VehicleGroupWindow::OnDropdownSelect(), VehicleListWindow::OnDropdownSelect(), VehicleListWindow::OnGameTick(), VehicleGroupWindow::OnPaint(), ToWindowNumber(), VehicleGroupWindow::UpdateWidgetSize(), and VehicleListWindow::UpdateWidgetSize().

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

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