|
OpenTTD Source 20251104-master-g3befbdd52f
|
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. | |
| std::string | GetTownName (const Town *t) |
| Get the name of the given town. | |
| bool | VerifyTownName (uint32_t r, const TownNameParams *par, TownNames *town_names=nullptr) |
| Verifies the town name is valid and unique. | |
| bool | GenerateTownName (Randomizer &randomizer, uint32_t *townnameparts, TownNames *town_names=nullptr) |
| Generates valid town name. | |
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(), GameCreationSettings::town_name, and VerifyTownName().
Referenced by GenerateTowns().
| 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.
References GetTownName().
| 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, Tpool_type, Tcache >::PoolItem<&_town_pool >::Iterate(), MAX_LENGTH_TOWN_NAME_CHARS, and Utf8StringLength().
Referenced by CmdFoundTown(), and GenerateTownName().