Codechange: inline sorter name definitions and use proper static accessor instead of (implying) this->

This commit is contained in:
Rubidium
2024-04-28 14:56:52 +02:00
committed by rubidium42
parent ef55cc7979
commit ad50c4f298
4 changed files with 61 additions and 75 deletions

View File

@@ -1325,7 +1325,13 @@ protected:
static Listing last_sorting;
/* Constants for sorting industries */
static const StringID sorter_names[];
static inline const StringID sorter_names[] = {
STR_SORT_BY_NAME,
STR_SORT_BY_TYPE,
STR_SORT_BY_PRODUCTION,
STR_SORT_BY_TRANSPORTED,
INVALID_STRING_ID
};
static const std::initializer_list<GUIIndustryList::SortFunction * const> sorter_funcs;
GUIIndustryList industries{IndustryDirectoryWindow::produced_cargo_filter};
@@ -1909,15 +1915,6 @@ const std::initializer_list<GUIIndustryList::SortFunction * const> IndustryDirec
&IndustryTransportedCargoSorter
};
/* Names of the sorting functions */
const StringID IndustryDirectoryWindow::sorter_names[] = {
STR_SORT_BY_NAME,
STR_SORT_BY_TYPE,
STR_SORT_BY_PRODUCTION,
STR_SORT_BY_TRANSPORTED,
INVALID_STRING_ID
};
CargoID IndustryDirectoryWindow::produced_cargo_filter = CargoFilterCriteria::CF_ANY;