# newgrf_townname.h

Go to the documentation of this file.

    00001 /* $Id$ */
    00002
    00003 /*
    00004  * This file is part of OpenTTD.
    00005  * 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.
    00006  * 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.
    00007  * 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/>.
    00008  */
    00009
    00015 #ifndef NEWGRF_TOWNNAME_H
    00016 #define NEWGRF_TOWNNAME_H
    00017
    00018 #include "strings_type.h"
    00019
    00020 struct NamePart {
    00021   byte prob;
    00022   union {
    00023     char *text;
    00024     byte id;
    00025   } data;
    00026 };
    00027
    00028 struct NamePartList {
    00029   byte partcount;
    00030   byte bitstart;
    00031   byte bitcount;
    00032   uint16 maxprob;
    00033   NamePart *parts;
    00034 };
    00035
    00036 struct GRFTownName {
    00037   uint32 grfid;
    00038   byte nb_gen;
    00039   byte id[128];
    00040   StringID name[128];
    00041   byte nbparts[128];
    00042   NamePartList *partlist[128];
    00043   GRFTownName *next;
    00044 };
    00045
    00046 GRFTownName *AddGRFTownName(uint32 grfid);
    00047 GRFTownName *GetGRFTownName(uint32 grfid);
    00048 void DelGRFTownName(uint32 grfid);
    00049 void CleanUpGRFTownNames();
    00050 StringID *GetGRFTownNameList();
    00051 char *GRFTownNameGenerate(char *buf, uint32 grfid, uint16 gen, uint32 seed, const char *last);
    00052 uint32 GetGRFTownNameId(int gen);
    00053 uint16 GetGRFTownNameType(int gen);
    00054
    00055 #endif /* NEWGRF_TOWNNAME_H */