OpenTTD Source 20250508-master-g6680169251
UnmappedChoiceList Struct Reference

Helper structure for mapping choice lists. More...

Public Member Functions

 UnmappedChoiceList (StringControlCode type, int offset)
 Initialise the mapping.
 
void Flush (const LanguageMap *lm, std::string &dest)
 Flush this choice list into the destination string.
 

Data Fields

StringControlCode type
 The type of choice list.
 
int offset
 The offset for the plural/gender form.
 
std::map< int, std::string > strings
 Mapping of NewGRF supplied ID to the different strings in the choice list.
 

Detailed Description

Helper structure for mapping choice lists.

Definition at line 110 of file newgrf_text.cpp.

Constructor & Destructor Documentation

◆ UnmappedChoiceList()

UnmappedChoiceList::UnmappedChoiceList ( StringControlCode  type,
int  offset 
)
inline

Initialise the mapping.

Parameters
typeThe type of mapping.
offsetThe offset to get the plural/gender from.

Definition at line 116 of file newgrf_text.cpp.

Member Function Documentation

◆ Flush()

void UnmappedChoiceList::Flush ( const LanguageMap lm,
std::string &  dest 
)
inline

Flush this choice list into the destination string.

Parameters
lmThe current language mapping.
destTarget to write to.

Definition at line 132 of file newgrf_text.cpp.

References _current_language, LanguageMap::GetReverseMapping(), LanguagePackHeader::num_cases, LanguagePackHeader::num_genders, LanguageMap::plural_form, BaseStringBuilder::PutUint16LE(), BaseStringBuilder::PutUint8(), and BaseStringBuilder::PutUtf8().

Field Documentation

◆ offset

int UnmappedChoiceList::offset

The offset for the plural/gender form.

Definition at line 122 of file newgrf_text.cpp.

◆ strings

std::map<int, std::string> UnmappedChoiceList::strings

Mapping of NewGRF supplied ID to the different strings in the choice list.

Definition at line 125 of file newgrf_text.cpp.

◆ type

StringControlCode UnmappedChoiceList::type

The type of choice list.

Definition at line 121 of file newgrf_text.cpp.


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