OpenTTD Source 20260108-master-g8ba1860eaa
townname_type.h
Go to the documentation of this file.
1/*
2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <https://www.gnu.org/licenses/old-licenses/gpl-2.0>.
6 */
7
10#ifndef TOWNNAME_TYPE_H
11#define TOWNNAME_TYPE_H
12
13#include "newgrf_townname.h"
14#include "town_type.h"
15#include "string_type.h"
16
17typedef std::set<std::string> TownNames;
18
24 uint32_t grfid;
25 uint16_t type;
26
31 TownNameParams(uint8_t town_name)
32 {
33 bool grf = town_name >= BUILTIN_TOWNNAME_GENERATOR_COUNT;
34 this->grfid = grf ? GetGRFTownNameId(town_name - BUILTIN_TOWNNAME_GENERATOR_COUNT) : 0;
35 this->type = grf ? GetGRFTownNameType(town_name - BUILTIN_TOWNNAME_GENERATOR_COUNT) : SPECSTR_TOWNNAME_START + town_name;
36 }
37
38 TownNameParams(const Town *t);
39};
40
41#endif /* TOWNNAME_TYPE_H */
Header of Action 0F "universal holder" structure and functions.
Types for strings.
static constexpr uint32_t BUILTIN_TOWNNAME_GENERATOR_COUNT
The number of builtin generators for town names.
static constexpr StringID SPECSTR_TOWNNAME_START
Special strings for town names.
Struct holding parameters used to generate town name.
TownNameParams(uint8_t town_name)
Initializes this struct from language ID.
uint16_t type
town name style
uint32_t grfid
newgrf ID (0 if not used)
Town data structure.
Definition town.h:63
Types related to towns.