Town name generator stuff. More...
#include "townname_type.h"Go to the source code of this file.
Functions | |
| char * | GenerateTownNameString (char *buf, const char *last, size_t lang, uint32 seed) |
| Generates town name from given seed. | |
| char * | GetTownName (char *buff, const TownNameParams *par, uint32 townnameparts, const char *last) |
| Fills buffer with specified town name. | |
| char * | GetTownName (char *buff, const Town *t, const char *last) |
| Fills buffer with town's name. | |
| bool | VerifyTownName (uint32 r, const TownNameParams *par) |
| Verifies the town name is valid and unique. | |
| bool | GenerateTownName (uint32 *townnameparts) |
| Generates valid town name. | |
Town name generator stuff.
Definition in file townname_func.h.
| bool GenerateTownName | ( | uint32 * | townnameparts | ) |
Generates valid town name.
| townnameparts | if a name is generated, it's stored there |
Definition at line 112 of file townname.cpp.
References _generating_world, _settings_game, GameSettings::game_creation, GameCreationSettings::town_name, and VerifyTownName().
Referenced by GenerateTowns().
| char* GenerateTownNameString | ( | char * | buf, | |
| const char * | last, | |||
| size_t | lang, | |||
| uint32 | seed | |||
| ) |
Generates town name from given seed.
a language.
| buf | output buffer | |
| last | end of buffer | |
| lang | town name language | |
| seed | generation seed |
Definition at line 1040 of file townname.cpp.
References AllocaM, lengthof, TownNameGeneratorParams::min, TownNameGeneratorParams::proc, and strecpy().
Referenced by FormatString().
| char* GetTownName | ( | char * | buff, | |
| const TownNameParams * | par, | |||
| uint32 | townnameparts, | |||
| const char * | last | |||
| ) |
Fills buffer with specified town name.
| buff | buffer start | |
| par | town name parameters | |
| townnameparts | 'encoded' town name | |
| last | end of buffer |
Definition at line 48 of file townname.cpp.
References GetStringWithArgs(), TownNameParams::grfid, and TownNameParams::type.
Referenced by FormatString(), GetTownName(), and VerifyTownName().
| char* GetTownName | ( | char * | buff, | |
| const Town * | t, | |||
| const char * | last | |||
| ) |
Fills buffer with town's name.
| buff | buffer start | |
| t | we want to get name of this town | |
| last | end of buffer |
Definition at line 67 of file townname.cpp.
References GetTownName().
| bool VerifyTownName | ( | uint32 | r, | |
| const TownNameParams * | par | |||
| ) |
Verifies the town name is valid and unique.
| r | random bits | |
| par | town name parameters |
Definition at line 80 of file townname.cpp.
References GetTownName(), lastof, MAX_CHAR_LENGTH, MAX_LENGTH_TOWN_NAME_CHARS, and Utf8StringLength().
Referenced by CmdFoundTown(), and GenerateTownName().
1.7.1