|
OpenTTD Source
14.0-beta1
|
Go to the documentation of this file.
72 static const StringID _start_replace_dropdown[] = {
73 STR_REPLACE_VEHICLES_NOW,
74 STR_REPLACE_VEHICLES_WHEN_OLD,
107 if ((rvi->railveh_type ==
RAILVEH_WAGON) == show_engines)
return false;
111 if (rvi->
railtype != this->sel_railtype)
return false;
118 for (
const auto &item : source) {
119 if (item.variant_id !=
parent || item.engine_id ==
parent)
continue;
132 AddChildren(source, target, item.engine_id, indent + 1, side);
143 std::vector<EngineID> variants;
146 byte side = draw_left ? 0 : 1;
161 if (e->u.road.
roadtype != this->sel_roadtype)
continue;
183 variants.push_back(
parent);
187 if (eid == this->sel_engine[side]) selected_engine = eid;
192 for (
const auto &variant : variants) {
193 if (std::find(list.begin(), list.end(), variant) == list.end()) {
200 this->sel_engine[side] = selected_engine;
208 this->engines[side].clear();
212 this->engines[side].swap(list);
221 if (this->engines[0].NeedRebuild()) {
224 this->vscroll[0]->
SetCount(this->engines[0].size());
225 if (this->reset_sel_engine && this->sel_engine[0] ==
INVALID_ENGINE && !this->engines[0].empty()) {
226 this->sel_engine[0] = this->engines[0][0].engine_id;
230 if (this->engines[1].NeedRebuild() || e != this->sel_engine[0]) {
234 this->engines[1].clear();
236 this->vscroll[1]->
SetCount(this->engines[1].size());
238 if (this->reset_sel_engine && this->sel_engine[0] !=
INVALID_ENGINE) {
245 this->vscroll[1]->
SetCount(this->engines[1].size());
246 if (this->reset_sel_engine && this->sel_engine[1] !=
INVALID_ENGINE) {
248 for (
const auto &item : this->engines[1]) {
249 if (item.engine_id == this->sel_engine[1])
break;
259 this->reset_sel_engine =
false;
268 EngineID veh_from = this->sel_engine[0];
269 EngineID veh_to = this->sel_engine[1];
284 this->reset_sel_engine =
true;
293 this->replace_engines =
true;
296 this->reset_sel_engine =
true;
297 this->details_height = ((vehicletype ==
VEH_TRAIN) ? 10 : 9);
307 widget->
widget_data = STR_SHOW_HIDDEN_ENGINES_VEHICLE_TRAIN + vehicletype;
308 widget->
tool_tip = STR_SHOW_HIDDEN_ENGINES_VEHICLE_TRAIN_TOOLTIP + vehicletype;
309 widget->
SetLowered(this->show_hidden_engines);
315 this->sel_group = id_g;
324 d.height += padding.height;
341 StringID str = this->GetWidget<NWidgetCore>(widget)->widget_data;
346 d.width += padding.width;
347 d.height += padding.height;
355 d.width += padding.width;
356 d.height += padding.height;
364 d.width += padding.width;
365 d.height += padding.height;
372 for (
const RailType &rt : _sorted_railtypes) {
375 d.width += padding.width;
376 d.height += padding.height;
383 for (
const RoadType &rt : _sorted_roadtypes) {
386 d.width += padding.width;
387 d.height += padding.height;
397 d.width += padding.width;
398 d.height += padding.height;
405 void SetStringParameters(
WidgetID widget)
const override
410 switch (this->sel_group) {
442 SetDParam(2, remove_wagon ? STR_CONFIG_SETTING_ON : STR_CONFIG_SETTING_OFF);
447 SetDParam(0, this->replace_engines ? STR_REPLACE_ENGINES : STR_REPLACE_WAGONS);
460 void DrawWidget(
const Rect &r,
WidgetID widget)
const override
472 str = STR_REPLACE_NOT_REPLACING;
474 bool when_old =
false;
476 str = when_old ? STR_REPLACE_REPLACING_WHEN_OLD : STR_ENGINE_NAME;
480 str = STR_REPLACE_NOT_REPLACING_VEHICLE_SELECTED;
491 EngineID end =
static_cast<EngineID>(std::min<size_t>(this->vscroll[side]->GetCapacity() + start, this->engines[side].size()));
502 if (this->engines[0].NeedRebuild() || this->engines[1].NeedRebuild()) this->
GenerateLists();
522 for (
int side = 0; side < 2; side++) {
528 ted.FillDefaultCapacities(e);
536 if (needed_height != this->details_height) {
537 this->details_height = needed_height;
544 void OnClick([[maybe_unused]]
Point pt,
WidgetID widget, [[maybe_unused]]
int click_count)
override
548 this->descending_sort_order ^=
true;
555 this->show_hidden_engines ^=
true;
568 list.push_back(std::make_unique<DropDownListStringItem>(STR_REPLACE_ENGINES, 1,
false));
569 list.push_back(std::make_unique<DropDownListStringItem>(STR_REPLACE_WAGONS, 0,
false));
579 ShowDropDownList(
this, GetRoadTypeDropDownList(RTTB_ROAD | RTTB_TRAM,
true,
true), this->sel_roadtype, widget);
594 if (this->GetWidget<NWidgetLeaf>(widget)->ButtonHit(pt)) {
605 EngineID veh_from = this->sel_engine[0];
621 if (it != this->engines[click_side].end()) {
622 const auto &item = *it;
646 if (e == this->sel_engine[click_side])
break;
647 this->sel_engine[click_side] = e;
648 if (click_side == 0) {
650 this->reset_sel_engine =
true;
658 void OnDropdownSelect(
WidgetID widget,
int index)
override
662 if (this->sort_criteria != index) {
663 this->sort_criteria = index;
672 if (temp == this->sel_railtype)
return;
673 this->sel_railtype = temp;
680 if (temp == this->sel_roadtype)
return;
681 this->sel_roadtype = temp;
687 this->replace_engines = index != 0;
689 this->reset_sel_engine =
true;
700 bool OnTooltip([[maybe_unused]]
Point pt,
WidgetID widget, TooltipCloseCondition close_cond)
override
705 SetDParam(0, STR_REPLACE_REMOVE_WAGON_HELP);
706 GuiShowTooltips(
this, STR_REPLACE_REMOVE_WAGON_GROUP_HELP, close_cond, 1);
724 void OnInvalidateData([[maybe_unused]]
int data = 0, [[maybe_unused]]
bool gui_scope =
true)
override
735 static constexpr
NWidgetPart _nested_replace_rail_vehicle_widgets[] = {
745 NWidget(
WWT_LABEL, COLOUR_GREY),
SetDataTip(STR_REPLACE_VEHICLE_VEHICLES_IN_USE, STR_REPLACE_VEHICLE_VEHICLES_IN_USE_TOOLTIP),
SetFill(1, 1),
SetMinimalSize(0, 12),
SetResize(1, 0),
748 NWidget(
WWT_LABEL, COLOUR_GREY),
SetDataTip(STR_REPLACE_VEHICLE_AVAILABLE_VEHICLES, STR_REPLACE_VEHICLE_AVAILABLE_VEHICLES_TOOLTIP),
SetFill(1, 1),
SetMinimalSize(0, 12),
SetResize(1, 0),
754 NWidget(
WWT_DROPDOWN, COLOUR_GREY,
WID_RV_RAIL_TYPE_DROPDOWN),
SetMinimalSize(136, 12),
SetDataTip(STR_JUST_STRING, STR_REPLACE_HELP_RAILTYPE),
SetFill(1, 0),
SetResize(1, 0),
771 NWidget(
WWT_MATRIX, COLOUR_GREY,
WID_RV_LEFT_MATRIX),
SetMinimalSize(216, 0),
SetFill(1, 1),
SetMatrixDataTip(1, 0, STR_REPLACE_HELP_LEFT_ARRAY),
SetResize(1, 1),
SetScrollbar(
WID_RV_LEFT_SCROLLBAR),
773 NWidget(
WWT_MATRIX, COLOUR_GREY,
WID_RV_RIGHT_MATRIX),
SetMinimalSize(216, 0),
SetFill(1, 1),
SetMatrixDataTip(1, 0, STR_REPLACE_HELP_RIGHT_ARRAY),
SetResize(1, 1),
SetScrollbar(
WID_RV_RIGHT_SCROLLBAR),
780 NWidget(
WWT_PUSHTXTBTN, COLOUR_GREY,
WID_RV_TRAIN_WAGONREMOVE_TOGGLE),
SetMinimalSize(138, 12),
SetDataTip(STR_REPLACE_REMOVE_WAGON, STR_REPLACE_REMOVE_WAGON_HELP),
SetFill(1, 0),
SetResize(1, 0),
792 static WindowDesc _replace_rail_vehicle_desc(__FILE__, __LINE__,
793 WDP_AUTO,
"replace_vehicle_train", 500, 140,
796 std::begin(_nested_replace_rail_vehicle_widgets), std::end(_nested_replace_rail_vehicle_widgets)
799 static constexpr
NWidgetPart _nested_replace_road_vehicle_widgets[] = {
809 NWidget(
WWT_LABEL, COLOUR_GREY),
SetDataTip(STR_REPLACE_VEHICLE_VEHICLES_IN_USE, STR_REPLACE_VEHICLE_VEHICLES_IN_USE_TOOLTIP),
SetFill(1, 1),
SetMinimalSize(0, 12),
SetResize(1, 0),
812 NWidget(
WWT_LABEL, COLOUR_GREY),
SetDataTip(STR_REPLACE_VEHICLE_AVAILABLE_VEHICLES, STR_REPLACE_VEHICLE_AVAILABLE_VEHICLES_TOOLTIP),
SetFill(1, 1),
SetMinimalSize(0, 12),
SetResize(1, 0),
817 NWidget(
WWT_DROPDOWN, COLOUR_GREY,
WID_RV_ROAD_TYPE_DROPDOWN),
SetMinimalSize(136, 12),
SetDataTip(STR_JUST_STRING, STR_REPLACE_HELP_ROADTYPE),
SetFill(1, 0),
SetResize(1, 0),
832 NWidget(
WWT_MATRIX, COLOUR_GREY,
WID_RV_LEFT_MATRIX),
SetMinimalSize(216, 0),
SetFill(1, 1),
SetMatrixDataTip(1, 0, STR_REPLACE_HELP_LEFT_ARRAY),
SetResize(1, 1),
SetScrollbar(
WID_RV_LEFT_SCROLLBAR),
834 NWidget(
WWT_MATRIX, COLOUR_GREY,
WID_RV_RIGHT_MATRIX),
SetMinimalSize(216, 0),
SetFill(1, 1),
SetMatrixDataTip(1, 0, STR_REPLACE_HELP_RIGHT_ARRAY),
SetResize(1, 1),
SetScrollbar(
WID_RV_RIGHT_SCROLLBAR),
850 static WindowDesc _replace_road_vehicle_desc(__FILE__, __LINE__,
851 WDP_AUTO,
"replace_vehicle_road", 500, 140,
854 std::begin(_nested_replace_road_vehicle_widgets), std::end(_nested_replace_road_vehicle_widgets)
857 static constexpr
NWidgetPart _nested_replace_vehicle_widgets[] = {
867 NWidget(
WWT_LABEL, COLOUR_GREY),
SetDataTip(STR_REPLACE_VEHICLE_VEHICLES_IN_USE, STR_REPLACE_VEHICLE_VEHICLES_IN_USE_TOOLTIP),
SetFill(1, 1),
SetMinimalSize(0, 12),
SetResize(1, 0),
870 NWidget(
WWT_LABEL, COLOUR_GREY),
SetDataTip(STR_REPLACE_VEHICLE_AVAILABLE_VEHICLES, STR_REPLACE_VEHICLE_AVAILABLE_VEHICLES_TOOLTIP),
SetFill(1, 1),
SetMinimalSize(0, 12),
SetResize(1, 0),
887 NWidget(
WWT_MATRIX, COLOUR_GREY,
WID_RV_LEFT_MATRIX),
SetMinimalSize(216, 0),
SetFill(1, 1),
SetMatrixDataTip(1, 0, STR_REPLACE_HELP_LEFT_ARRAY),
SetResize(1, 1),
SetScrollbar(
WID_RV_LEFT_SCROLLBAR),
889 NWidget(
WWT_MATRIX, COLOUR_GREY,
WID_RV_RIGHT_MATRIX),
SetMinimalSize(216, 0),
SetFill(1, 1),
SetMatrixDataTip(1, 0, STR_REPLACE_HELP_RIGHT_ARRAY),
SetResize(1, 1),
SetScrollbar(
WID_RV_RIGHT_SCROLLBAR),
898 NWidget(
WWT_PANEL, COLOUR_GREY,
WID_RV_INFO_TAB),
SetMinimalSize(167, 12),
SetDataTip(0x0, STR_REPLACE_HELP_REPLACE_INFO_TAB),
SetResize(1, 0),
EndContainer(),
904 static WindowDesc _replace_vehicle_desc(__FILE__, __LINE__,
905 WDP_AUTO,
"replace_vehicle", 456, 118,
908 std::begin(_nested_replace_vehicle_widgets), std::end(_nested_replace_vehicle_widgets)
920 switch (vehicletype) {
921 case VEH_TRAIN: desc = &_replace_rail_vehicle_desc;
break;
922 case VEH_ROAD: desc = &_replace_road_vehicle_desc;
break;
923 default: desc = &_replace_vehicle_desc;
break;
EngList_SortTypeFunction *const _engine_sort_functions[][11]
Sort functions for the vehicle sort criteria, for each vehicle type.
void DisplayVehicleSortDropDown(Window *w, VehicleType vehicle_type, int selected, WidgetID button)
Display the dropdown for the vehicle sort criteria.
static const EngineID INVALID_ENGINE
Constant denoting an invalid engine.
bool IsVariantHidden(CompanyID c) const
Check whether the engine variant chain is hidden in the GUI for the given company.
void InvalidateWindowData(WindowClass cls, WindowNumber number, int data, bool gui_scope)
Mark window data of the window of a given class and specific window number as invalid (in need of re-...
static bool EngineNumberSorter(const GUIEngineListItem &a, const GUIEngineListItem &b)
Determines order of engines by engineID.
static Pool::IterateWrapperFiltered< Engine, EngineTypeFilter > IterateType(VehicleType vt, size_t from=0)
Returns an iterable ensemble of all valid engines of the given type.
@ HasVariants
Set if engine has variants.
EngineID EngineReplacementForCompany(const Company *c, EngineID engine, GroupID group, bool *replace_when_old=nullptr)
Retrieve the engine replacement for the given company and original engine type.
static Titem * Get(size_t index)
Returns Titem with given index.
DropDownList GetRailTypeDropDownList(bool for_replacement, bool all_option)
Create a drop down list for all the rail types of the local company.
GroupID sel_group
Group selected to replace.
Dimensions (a width and height) of a rectangle in 2D.
constexpr bool IsInsideMM(const T x, const size_t min, const size_t max) noexcept
Checks if a value is in an interval.
bool replace_engines
If true, engines are replaced, if false, wagons are replaced (only for trains).
static Titem * GetIfValid(size_t index)
Returns Titem with given index.
@ WDF_CONSTRUCTION
This window is used for construction; close it whenever changing company.
const RailTypeInfo * GetRailTypeInfo(RailType railtype)
Returns a pointer to the Railtype information for a given railtype.
Rect Shrink(int s) const
Copy and shrink Rect by s pixels.
bool _engine_sort_last_order[]
Last set direction of the sort order, for each vehicle type.
@ IsFolded
Set if display of variants should be folded (hidden).
void GenerateReplaceVehList(bool draw_left)
Generate an engines list.
bool _engine_sort_direction
false = descending, true = ascending.
uint32_t StringID
Numeric value that represents a string, independent of the selected language.
void CloseWindowById(WindowClass cls, WindowNumber number, bool force, int data)
Close a window by its class and window number (if it is open).
std::vector< std::unique_ptr< const DropDownListItem > > DropDownList
A drop down list is a collection of drop down list items.
bool EngineHasReplacementWhenOldForCompany(const Company *c, EngineID engine, GroupID group)
Check if a company has a replacement set up for the given engine when it gets old.
Tindex index
Index of this pool item.
Dimension maxdim(const Dimension &d1, const Dimension &d2)
Compute bounding box of both dimensions.
bool _ctrl_pressed
Is Ctrl pressed?
Owner owner
The owner of the content shown in this window. Company colour is acquired from this variable.
StringID replace_text
Text used in the autoreplace GUI.
@ VEH_ROAD
Road vehicle type.
RoadType roadtype
Road type.
const Scrollbar * GetScrollbar(WidgetID widnum) const
Return the Scrollbar to a widget index.
GUIEngineList engines[2]
Left and right list of engines.
bool _engine_sort_show_hidden_engines[]
Last set 'show hidden engines' setting for each vehicle type.
@ INVALID_ROADTYPE
flag for invalid roadtype
static const GroupID ALL_GROUP
All vehicles are in this group.
High level window description.
void OnPaint() override
The window must be repainted.
bool renew_keep_length
sell some wagons if after autoreplace the train is longer than before
void OnRailRoadTypeChange()
Perform tasks after rail or road type is changed.
EngineID display_last_variant
NOSAVE client-side-only last variant selected.
void OnResize() override
Called after the window got resized.
Information about a rail vehicle.
const StringID _engine_sort_listing[][12]
Dropdown menu strings for the vehicle sort criteria.
bool EngineHasReplacementForCompany(const Company *c, EngineID engine, GroupID group)
Check if a company has a replacement set up for the given engine.
@ WDP_AUTO
Find a place automatically.
RailType
Enumeration for all possible railtypes.
ResizeInfo resize
Resize information.
RoadType sel_roadtype
Type of road selected. INVALID_ROADTYPE to show all.
@ FS_NORMAL
Index of the normal font in the font tables.
void HandleButtonClick(WidgetID widget)
Do all things to make a button look clicked and mark it to be unclicked in a few ticks.
EngineID sel_engine[2]
Selected engine left and right.
void DrawEngineList(VehicleType type, const Rect &r, const GUIEngineList &eng_list, uint16_t min, uint16_t max, EngineID selected_id, bool show_count, GroupID selected_group)
Engine drawing loop.
uint64_t PackEngineNameDParam(EngineID engine_id, EngineNameContext context, uint32_t extra_data=0)
Combine an engine ID and a name context to an engine name dparam.
void SetDirty() const
Mark entire window as dirty (in need of re-paint)
bool descending_sort_order
Order of sorting vehicles.
EngineDisplayFlags display_flags
NOSAVE client-side-only display flags for build engine list.
@ WC_REPLACE_VEHICLE
Replace vehicle window; Window numbers:
@ Shaded
Set if engine should be masked.
CompanySettings settings
settings specific for each company
void ReInit(int rx=0, int ry=0, bool reposition=false)
Re-initialize a window, and optionally change its size.
Window * parent
Parent window.
CompanyID _local_company
Company controlled by the human player at this client. Can also be COMPANY_SPECTATOR.
WindowFlags flags
Window flags.
void GenerateLists()
Generate the lists.
static const GroupID DEFAULT_GROUP
Ungrouped vehicles are in this group.
Extra information about refitted cargo and capacity.
fluid_settings_t * settings
FluidSynth settings handle.
int details_height
Minimal needed height of the details panels, in text lines (found so far).
Rect WithWidth(int width, bool end) const
Copy Rect and set its width.
bool GenerateReplaceRailList(EngineID e, bool draw_left, bool show_engines)
Figure out if an engine should be added to a list.
bool reset_sel_engine
Also reset sel_engine while updating left and/or right and no valid engine selected.
Coordinates of a point in 2D.
void ShowDropDownMenu(Window *w, const StringID *strings, int selected, WidgetID button, uint32_t disabled_mask, uint32_t hidden_mask, uint width)
Show a dropdown menu window near a widget of the parent window.
byte _engine_sort_last_criteria[]
Last set sort criteria, for each vehicle type.
WindowNumber window_number
Window number within the window class.
VehicleType
Available vehicle types.
@ WC_NONE
No window, redirects to WC_MAIN_WINDOW.
@ SA_HOR_CENTER
Horizontally center the text.
void SetWidgetLoweredState(WidgetID widget_index, bool lowered_stat)
Sets the lowered/raised status of a widget.
@ RAILVEH_WAGON
simple wagon, not motorized
EngineID engine_id
Engine to display in build purchase list.
void EngList_Sort(GUIEngineList &el, EngList_SortTypeFunction compare)
Sort all items using quick sort and given 'CompareItems' function.
const RoadTypeInfo * GetRoadTypeInfo(RoadType roadtype)
Returns a pointer to the Roadtype information for a given roadtype.
void SetWidgetDisabledState(WidgetID widget_index, bool disab_stat)
Sets the enabled/disabled status of a widget.
Window for the autoreplacing of vehicles.
void ForceRebuild()
Force that a rebuild is needed.
@ SBS_DOWN
Sort ascending.
void DrawSortButtonState(WidgetID widget, SortButtonState state) const
Draw a sort button's up or down arrow symbol.
void GuiShowTooltips(Window *parent, StringID str, TooltipCloseCondition close_tooltip, uint paramcount)
Shows a tooltip.
void CreateNestedTree()
Perform the first part of the initialization of a nested widget tree.
void ShowDropDownList(Window *w, DropDownList &&list, int selected, WidgetID button, uint width, bool instant_close)
Show a drop down list.
uint8_t flags
Group flags.
bool IsShaded() const
Is window shaded currently?
EngineDisplayFlags
Flags used client-side in the purchase/autorenew engine list.
@ WC_BUILD_VEHICLE
Build vehicle; Window numbers:
void ShowReplaceGroupVehicleWindow(GroupID id_g, VehicleType vehicletype)
Show the autoreplace configuration window for a particular group.
void SetDParam(size_t n, uint64_t v)
Set a string parameter v at index n in the global string parameter array.
void InvalidateWindowClassesData(WindowClass cls, int data, bool gui_scope)
Mark window data of all windows of a given class as invalid (in need of re-computing) Note that by de...
EngineID variant_id
Engine variant ID. If set, will be treated specially in purchase lists.
void OnInvalidateData([[maybe_unused]] int data=0, [[maybe_unused]] bool gui_scope=true) override
Some data on this window has become invalid.
bool show_hidden_engines
Whether to show the hidden engines.
RoadType
The different roadtypes we support.
RailType railtype
Railtype, mangled if elrail is disabled.
void FinishInitNested(WindowNumber window_number=0)
Perform the second part of the initialization of a nested widget tree.
uint16_t GroupID
Type for all group identifiers.
RailType sel_railtype
Type of rail tracks selected. INVALID_RAILTYPE to show all.
uint GetGroupNumEngines(CompanyID company, GroupID id_g, EngineID id_e)
Get the number of engines with EngineID id_e in the group with GroupID id_g and its sub-groups.
void InvalidateAutoreplaceWindow(EngineID e, GroupID id_g)
Rebuild the left autoreplace list if an engine is removed or added.
int GetCharacterHeight(FontSize size)
Get height of a character for a given font size.
static int SortButtonWidth()
Get width of up/down arrow of sort button state.
void RebuildDone()
Notify the sortlist that the rebuild is done.
byte sort_criteria
Criteria of sorting vehicles.
int DrawString(int left, int right, int top, std::string_view str, TextColour colour, StringAlignment align, bool underline, FontSize fontsize)
Draw string, possibly truncated to make it fit in its allocated space.
bool CheckAutoreplaceValidity(EngineID from, EngineID to, CompanyID company)
Checks some basic properties whether autoreplace is allowed.
uint16_t EngineID
Unique identification number of an engine.
Data structure for an opened window.
@ VEH_TRAIN
Train vehicle type.
static bool IsValidID(size_t index)
Tests whether given index can be used to get valid (non-nullptr) Titem.
void DrawWidgets() const
Paint all widgets of a window.
void AddRemoveEngineFromAutoreplaceAndBuildWindows(VehicleType type)
When an engine is made buildable or is removed from being buildable, add/remove it from the build/aut...
Specification of a rectangle with absolute coordinates of all edges.
StringID replace_text
Text used in the autoreplace GUI.
int DrawVehiclePurchaseInfo(int left, int right, int y, EngineID engine_number, TestedEngineDetails &te)
Draw the purchase info details of a vehicle at a given location.
uint GetEngineListHeight(VehicleType type)
Get the height of a single 'entry' in the engine lists.
@ TD_RTL
Text is written right-to-left by default.
TextDirection _current_text_dir
Text direction of the currently selected language.
Dimension GetStringBoundingBox(std::string_view str, FontSize start_fontsize)
Return the string dimension in pixels.
void ReplaceClick_StartReplace(bool replace_when_old)
Handle click on the start replace button.
static const StringID INVALID_STRING_ID
Constant representing an invalid string (16bit in case it is used in savegames)
@ GF_REPLACE_WAGON_REMOVAL
If set, autoreplace will perform wagon removal on vehicles in this group.
@ PurchaseList
Name is shown in the purchase list (including autoreplace window 'Available vehicles' panel).
@ INVALID_RAILTYPE
Flag for invalid railtype.
constexpr debug_inline bool HasBit(const T x, const uint8_t y)
Checks if a bit in a value is set.