OpenTTD Source 20241224-master-gf74b0cf984
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::ostringstream &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< uint8_t, std::stringstream > 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 108 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 114 of file newgrf_text.cpp.

Member Function Documentation

◆ Flush()

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

Flush this choice list into the destination string.

Parameters
lmThe current language mapping.
destTarget to write to.

Definition at line 130 of file newgrf_text.cpp.

References _current_language, GB(), LanguageMap::GetReverseMapping(), LanguagePackHeader::num_cases, LanguagePackHeader::num_genders, LanguageMap::plural_form, and Utf8Encode().

Referenced by TranslateTTDPatchCodes().

Field Documentation

◆ offset

int UnmappedChoiceList::offset

The offset for the plural/gender form.

Definition at line 120 of file newgrf_text.cpp.

◆ strings

std::map<uint8_t, std::stringstream> UnmappedChoiceList::strings

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

Definition at line 123 of file newgrf_text.cpp.

Referenced by TranslateTTDPatchCodes().

◆ type

StringControlCode UnmappedChoiceList::type

The type of choice list.

Definition at line 119 of file newgrf_text.cpp.


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