OpenTTD
newgrf_townname.h
Go to the documentation of this file.
1 /* $Id: newgrf_townname.h 24900 2013-01-08 22:46:42Z planetmaker $ */
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 NEWGRF_TOWNNAME_H
16 #define NEWGRF_TOWNNAME_H
17 
18 #include "strings_type.h"
19 
20 struct NamePart {
21  byte prob;
22  union {
23  char *text;
24  byte id;
25  } data;
26 };
27 
28 struct NamePartList {
29  byte partcount;
30  byte bitstart;
31  byte bitcount;
32  uint16 maxprob;
33  NamePart *parts;
34 };
35 
36 struct GRFTownName {
37  uint32 grfid;
38  byte nb_gen;
39  byte id[128];
40  StringID name[128];
41  byte nbparts[128];
42  NamePartList *partlist[128];
43  GRFTownName *next;
44 };
45 
46 GRFTownName *AddGRFTownName(uint32 grfid);
47 GRFTownName *GetGRFTownName(uint32 grfid);
48 void DelGRFTownName(uint32 grfid);
49 void CleanUpGRFTownNames();
50 StringID *GetGRFTownNameList();
51 char *GRFTownNameGenerate(char *buf, uint32 grfid, uint16 gen, uint32 seed, const char *last);
52 uint32 GetGRFTownNameId(int gen);
53 uint16 GetGRFTownNameType(int gen);
54 
55 #endif /* NEWGRF_TOWNNAME_H */
char * text
If probability bit 7 is clear.
uint32 StringID
Numeric value that represents a string, independent of the selected language.
Definition: strings_type.h:18
byte prob
The relative probability of the following name to appear in the bottom 7 bits.
Types related to strings.
byte id
If probability bit 7 is set.