OpenTTD Source 20250905-master-g122023be8d
|
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 757 of file window_type.h.
|
inline |
Definition at line 762 of file window_type.h.
|
inline |
Definition at line 763 of file window_type.h.
|
inline |
Definition at line 766 of file window_type.h.
|
inline |
Definition at line 770 of file window_type.h.
|
inlineconstexpr |
Definition at line 773 of file window_type.h.
|
inlineconstexpr |
Definition at line 772 of file window_type.h.
|
private |
Definition at line 759 of file window_type.h.