Translations update
[openttd/fttd.git] / src / newgrf_townname.h
blobf4941a4b05242771d34cf5abb04777a14c182439
1 /* $Id$ */
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 */
10 /**
11 * @file newgrf_townname.h
12 * Header of Action 0F "universal holder" structure and functions
15 #ifndef NEWGRF_TOWNNAME_H
16 #define NEWGRF_TOWNNAME_H
18 #include "string.h"
19 #include "strings_type.h"
21 struct NamePart {
22 byte prob; ///< The relative probability of the following name to appear in the bottom 7 bits.
23 union {
24 char *text; ///< If probability bit 7 is clear
25 byte id; ///< If probability bit 7 is set
26 } data;
29 struct NamePartList {
30 byte partcount;
31 byte bitstart;
32 byte bitcount;
33 uint16 maxprob;
34 NamePart *parts;
37 struct GRFTownName {
38 uint32 grfid;
39 byte nb_gen;
40 byte id[128];
41 StringID name[128];
42 byte nbparts[128];
43 NamePartList *partlist[128];
44 GRFTownName *next;
47 GRFTownName *AddGRFTownName(uint32 grfid);
48 GRFTownName *GetGRFTownName(uint32 grfid);
49 void DelGRFTownName(uint32 grfid);
50 void CleanUpGRFTownNames();
51 StringID *GetGRFTownNameList();
52 void GRFTownNameGenerate (stringb *buf, uint32 grfid, uint16 gen, uint32 seed);
54 #endif /* NEWGRF_TOWNNAME_H */