|
OpenTTD Source 20260711-master-g3fb3006dff
|
Implementation of Action 0F "universal holder" structure and functions. More...
#include "stdafx.h"#include "newgrf_townname.h"#include "string_func.h"#include "strings_internal.h"#include "table/strings.h"#include "safeguards.h"Go to the source code of this file.
Functions | |
| GRFTownName * | GetGRFTownName (GrfID grfid) |
Get the GRFTownName for the given GRFID. | |
| GRFTownName * | AddGRFTownName (GrfID grfid) |
Get the GRFTownName for the given GRFID or allocate one if it does not exist. | |
| void | DelGRFTownName (GrfID grfid) |
Remove the GRFTownName mapping for the given GRFID. | |
| static void | RandomPart (StringBuilder &builder, const GRFTownName *t, uint32_t seed, uint8_t id) |
| void | GRFTownNameGenerate (StringBuilder &builder, GrfID grfid, uint16_t gen, uint32_t seed) |
| Construct a NewGRF town name into the builder. | |
| void | InitGRFTownGeneratorNames () |
| Allocate memory for the NewGRF town names. | |
| const std::vector< StringID > & | GetGRFTownNameList () |
| StringID | GetGRFTownNameName (uint16_t gen) |
| void | CleanUpGRFTownNames () |
| GrfID | GetGRFTownNameId (uint16_t gen) |
| uint16_t | GetGRFTownNameType (uint16_t gen) |
Variables | |
| static std::vector< GRFTownName > | _grf_townnames |
| static std::vector< StringID > | _grf_townname_names |
Implementation of Action 0F "universal holder" structure and functions.
This file implements a linked-lists of townname generators, holding everything that the newgrf action 0F will send over to OpenTTD.
Definition in file newgrf_townname.cpp.
| GRFTownName * AddGRFTownName | ( | GrfID | grfid | ) |
Get the GRFTownName for the given GRFID or allocate one if it does not exist.
| grfid | The GRFID of the town name. |
GRFTownName. Definition at line 44 of file newgrf_townname.cpp.
References GetGRFTownName(), and GRFTownName::grfid.
Referenced by FeatureTownName().
| void CleanUpGRFTownNames | ( | ) |
Definition at line 121 of file newgrf_townname.cpp.
| void DelGRFTownName | ( | GrfID | grfid | ) |
Remove the GRFTownName mapping for the given GRFID.
| grfid | The NewGRF to remove for. |
Definition at line 58 of file newgrf_townname.cpp.
References GRFTownName::grfid.
Referenced by FeatureTownName().
| GRFTownName * GetGRFTownName | ( | GrfID | grfid | ) |
Get the GRFTownName for the given GRFID.
| grfid | The GRFID of the town name. |
GRFTownName or nullptr if it does not exist. Definition at line 32 of file newgrf_townname.cpp.
References GRFTownName::grfid.
Referenced by AddGRFTownName(), GRFTownNameGenerate(), and TownNameParams::TownNameParams().
| GrfID GetGRFTownNameId | ( | uint16_t | gen | ) |
Definition at line 126 of file newgrf_townname.cpp.
| const std::vector< StringID > & GetGRFTownNameList | ( | ) |
Definition at line 111 of file newgrf_townname.cpp.
| StringID GetGRFTownNameName | ( | uint16_t | gen | ) |
Definition at line 116 of file newgrf_townname.cpp.
| uint16_t GetGRFTownNameType | ( | uint16_t | gen | ) |
Definition at line 136 of file newgrf_townname.cpp.
| void GRFTownNameGenerate | ( | StringBuilder & | builder, |
| GrfID | grfid, | ||
| uint16_t | gen, | ||
| uint32_t | seed ) |
Construct a NewGRF town name into the builder.
| builder | The string builder to write to. |
| grfid | The NewGRF providing the information/logic. |
| gen | The town name style to get from the NewGRF. |
| seed | The random 32 bit number to generate the town name for. |
Definition at line 90 of file newgrf_townname.cpp.
References GetGRFTownName(), and GRFTownName::styles.
Referenced by GetTownName().
| void InitGRFTownGeneratorNames | ( | ) |
Allocate memory for the NewGRF town names.
Definition at line 101 of file newgrf_townname.cpp.
References GRFTownName::styles.
Referenced by AfterLoadGRFs().
|
static |
Definition at line 63 of file newgrf_townname.cpp.
|
static |
Definition at line 25 of file newgrf_townname.cpp.
|
static |
Definition at line 24 of file newgrf_townname.cpp.