OpenTTD
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 <http://www.gnu.org/licenses/>.
6  */
7 
13 #ifndef TOWNNAME_TYPE_H
14 #define TOWNNAME_TYPE_H
15 
16 #include "newgrf_townname.h"
17 #include "town_type.h"
18 #include <set>
19 #include <string>
20 
21 typedef std::set<std::string> TownNames;
22 
28  uint32 grfid;
29  uint16 type;
30 
35  TownNameParams(byte town_name)
36  {
37  extern int _nb_orig_names;
38  bool grf = town_name >= _nb_orig_names;
39  this->grfid = grf ? GetGRFTownNameId(town_name - _nb_orig_names) : 0;
40  this->type = grf ? GetGRFTownNameType(town_name - _nb_orig_names) : SPECSTR_TOWNNAME_START + town_name;
41  }
42 
43  TownNameParams(const Town *t);
44 };
45 
46 #endif /* TOWNNAME_TYPE_H */
Types related to towns.
TownNameParams(byte town_name)
Initializes this struct from language ID.
Definition: townname_type.h:35
Header of Action 0F "universal holder" structure and functions.
uint16 type
town name style
Definition: townname_type.h:29
Town data structure.
Definition: town.h:53
Struct holding parameters used to generate town name.
Definition: townname_type.h:27
int _nb_orig_names
Number of original town names.
uint32 grfid
newgrf ID (0 if not used)
Definition: townname_type.h:28