OpenTTD
townname_type.h
Go to the documentation of this file.
1 /* $Id: townname_type.h 26313 2014-02-06 21:06:59Z rubidium $ */
2 
3 /*
4  * This file is part of OpenTTD.
5  * 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.
6  * 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.
7  * 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/>.
8  */
9 
15 #ifndef TOWNNAME_TYPE_H
16 #define TOWNNAME_TYPE_H
17 
18 #include "newgrf_townname.h"
19 #include "town_type.h"
20 #include <set>
21 #include <string>
22 
23 typedef std::set<std::string> TownNames;
24 
30  uint32 grfid;
31  uint16 type;
32 
37  TownNameParams(byte town_name)
38  {
39  extern int _nb_orig_names;
40  bool grf = town_name >= _nb_orig_names;
41  this->grfid = grf ? GetGRFTownNameId(town_name - _nb_orig_names) : 0;
42  this->type = grf ? GetGRFTownNameType(town_name - _nb_orig_names) : SPECSTR_TOWNNAME_START + town_name;
43  }
44 
45  TownNameParams(const Town *t);
46 };
47 
48 #endif /* TOWNNAME_TYPE_H */
Types related to towns.
TownNameParams(byte town_name)
Initializes this struct from language ID.
Definition: townname_type.h:37
Header of Action 0F "universal holder" structure and functions.
uint16 type
town name style
Definition: townname_type.h:31
Town data structure.
Definition: town.h:55
Struct holding a parameters used to generate town name.
Definition: townname_type.h:29
int _nb_orig_names
Number of original town names.
uint32 grfid
newgrf ID (0 if not used)
Definition: townname_type.h:30