OpenTTD Source
20241124-master-g9399a92a4f
|
Town name generator stuff. More...
Go to the source code of this file.
Functions | |
std::string | GetTownName (const TownNameParams *par, uint32_t townnameparts) |
Get the town name for the given parameters and parts. More... | |
std::string | GetTownName (const Town *t) |
Get the name of the given town. More... | |
bool | VerifyTownName (uint32_t r, const TownNameParams *par, TownNames *town_names=nullptr) |
Verifies the town name is valid and unique. More... | |
bool | GenerateTownName (Randomizer &randomizer, uint32_t *townnameparts, TownNames *town_names=nullptr) |
Generates valid town name. More... | |
Town name generator stuff.
Definition in file townname_func.h.
bool GenerateTownName | ( | Randomizer & | randomizer, |
uint32_t * | townnameparts, | ||
TownNames * | town_names | ||
) |
Generates valid town name.
randomizer | the source of random data for generating the name |
townnameparts | if a name is generated, it's stored there |
town_names | if a name is generated, check its uniqueness with the set |
Definition at line 136 of file townname.cpp.
References _settings_game, GameSettings::game_creation, Randomizer::Next(), Layouter::ReduceLineCache(), GameCreationSettings::town_name, and VerifyTownName().
std::string GetTownName | ( | const Town * | t | ) |
Get the name of the given town.
t | The town to get the name for. |
Definition at line 89 of file townname.cpp.
References GetTownName().
std::string GetTownName | ( | const TownNameParams * | par, |
uint32_t | townnameparts | ||
) |
Get the town name for the given parameters and parts.
par | Town name parameters. |
townnameparts | 'Encoded' town name. |
Definition at line 65 of file townname.cpp.
bool VerifyTownName | ( | uint32_t | r, |
const TownNameParams * | par, | ||
TownNames * | town_names | ||
) |
Verifies the town name is valid and unique.
r | random bits |
par | town name parameters |
town_names | if a name is generated, check its uniqueness with the set |
Definition at line 103 of file townname.cpp.
References GetTownName(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_town_pool >::Iterate(), MAX_LENGTH_TOWN_NAME_CHARS, and Utf8StringLength().
Referenced by GenerateTownName().