OpenTTD Source: WindowNumber Struct Reference

OpenTTD Source 15.0-RC2

Public Member Functions | Private Attributes
WindowNumber Struct Reference

Number to differentiate different windows of the same class. More...

`#include <window_type.h>`

## Public Member Functions
| WindowNumber (int32_t value)
| WindowNumber (ConvertibleThroughBase auto value)
| operator int32_t () const
template<typename T > requires (std::is_enum_v<T> || std::is_class_v<T>)
| operator T () const
constexpr bool | operator== (const std::integral auto &rhs) const
constexpr bool | operator== (const ConvertibleThroughBase auto &rhs) const

## Private Attributes
int32_t | value = 0

## Detailed Description

Number to differentiate different windows of the same class.

This number generally implicitly passes some information, e.g. the TileIndex or Company associated with the window. To ease this use, the window number is lenient with what it accepts and broad with what it returns.

Anything that converts into a number and ConvertibleThroughBase types will be accepted. When it's being used it returns int32_t or any other type when that's specifically requested, e.g. `VehicleType type = window_number` or `GetEngineListHeight(window_number)` in which the returned value will be a `VehicleType`.

Definition at line 760 of file window_type.h.

## Constructor & Destructor Documentation

## ◆ WindowNumber() [1/2]

WindowNumber::WindowNumber | ( | int32_t | value | ) |
| inline

Definition at line 765 of file window_type.h.

## ◆ WindowNumber() [2/2]

WindowNumber::WindowNumber | ( | ConvertibleThroughBase auto | value | ) |
| inline

Definition at line 766 of file window_type.h.

## Member Function Documentation

## ◆ operator int32_t()

WindowNumber::operator int32_t | ( |  | ) | const
| inline

Definition at line 769 of file window_type.h.

## ◆ operator T()

template<typename T >
requires (std::is_enum_v<T> || std::is_class_v<T>)

WindowNumber::operator T | ( |  | ) | const
| inline

Definition at line 773 of file window_type.h.

## ◆ operator==() [1/2]

constexpr bool WindowNumber::operator== | ( | const ConvertibleThroughBase auto & | rhs | ) | const
| inlineconstexpr

Definition at line 776 of file window_type.h.

## ◆ operator==() [2/2]

constexpr bool WindowNumber::operator== | ( | const std::integral auto & | rhs | ) | const
| inlineconstexpr

Definition at line 775 of file window_type.h.

## Field Documentation

## ◆ value

int32_t WindowNumber::value = 0
| private

Definition at line 762 of file window_type.h.

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

- src/window_type.h