Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00012 #ifndef NEWGRF_CLASS_H
00013 #define NEWGRF_CLASS_H
00014
00015 #include "strings_type.h"
00016
00020 template <typename Tspec, typename Tid, Tid Tmax>
00021 struct NewGRFClass {
00022 uint32 global_id;
00023 StringID name;
00024 uint count;
00025 Tspec **spec;
00026
00028 static NewGRFClass<Tspec, Tid, Tmax> classes[Tmax];
00029
00030 static void Reset();
00032 static void InsertDefaults();
00033
00034 static Tid Allocate(uint32 global_id);
00035 static void SetName(Tid cls_id, StringID name);
00036 static void Assign(Tspec *spec);
00037
00038 static StringID GetName(Tid cls_id);
00039 static uint GetCount();
00040 static uint GetCount(Tid cls_id);
00041 static const Tspec *Get(Tid cls_id, uint index);
00042 static const Tspec *GetByGrf(uint32 grfid, byte local_id, int *index);
00043 };
00044
00045 #endif