OpenTTD Source 20250518-master-g9bbc525e53
|
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 |
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 751 of file window_type.h.
|
inline |
Definition at line 756 of file window_type.h.
|
inline |
Definition at line 757 of file window_type.h.
|
inline |
Definition at line 760 of file window_type.h.
|
inline |
Definition at line 764 of file window_type.h.
|
inlineconstexpr |
Definition at line 767 of file window_type.h.
|
inlineconstexpr |
Definition at line 766 of file window_type.h.
|
private |
Definition at line 753 of file window_type.h.