OpenTTD Source 20260711-master-g3fb3006dff
newgrf_townname.h File Reference

Header of Action 0F "universal holder" structure and functions. More...

#include "newgrf_type.h"
#include "strings_type.h"

Go to the source code of this file.

Data Structures

struct  NamePart
struct  NamePartList
struct  TownNameStyle
struct  GRFTownName

Functions

GRFTownNameAddGRFTownName (GrfID grfid)
 Get the GRFTownName for the given GRFID or allocate one if it does not exist.
GRFTownNameGetGRFTownName (GrfID grfid)
 Get the GRFTownName for the given GRFID.
void DelGRFTownName (GrfID grfid)
 Remove the GRFTownName mapping for the given GRFID.
void CleanUpGRFTownNames ()
GrfID GetGRFTownNameId (uint16_t gen)
uint16_t GetGRFTownNameType (uint16_t gen)
StringID GetGRFTownNameName (uint16_t gen)
const std::vector< StringID > & GetGRFTownNameList ()

Detailed Description

Header of Action 0F "universal holder" structure and functions.

Definition in file newgrf_townname.h.

Function Documentation

◆ AddGRFTownName()

GRFTownName * AddGRFTownName ( GrfID grfid)

Get the GRFTownName for the given GRFID or allocate one if it does not exist.

Parameters
grfidThe GRFID of the town name.
Returns
The GRFTownName.

Definition at line 44 of file newgrf_townname.cpp.

References GetGRFTownName(), and GRFTownName::grfid.

Referenced by FeatureTownName().

◆ CleanUpGRFTownNames()

void CleanUpGRFTownNames ( )

Definition at line 121 of file newgrf_townname.cpp.

◆ DelGRFTownName()

void DelGRFTownName ( GrfID grfid)

Remove the GRFTownName mapping for the given GRFID.

Parameters
grfidThe NewGRF to remove for.

Definition at line 58 of file newgrf_townname.cpp.

References GRFTownName::grfid.

Referenced by FeatureTownName().

◆ GetGRFTownName()

GRFTownName * GetGRFTownName ( GrfID grfid)

Get the GRFTownName for the given GRFID.

Parameters
grfidThe GRFID of the town name.
Returns
The 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().

◆ GetGRFTownNameId()

GrfID GetGRFTownNameId ( uint16_t gen)

Definition at line 126 of file newgrf_townname.cpp.

◆ GetGRFTownNameList()

const std::vector< StringID > & GetGRFTownNameList ( )

Definition at line 111 of file newgrf_townname.cpp.

◆ GetGRFTownNameName()

StringID GetGRFTownNameName ( uint16_t gen)

Definition at line 116 of file newgrf_townname.cpp.

◆ GetGRFTownNameType()

uint16_t GetGRFTownNameType ( uint16_t gen)

Definition at line 136 of file newgrf_townname.cpp.