12 #ifndef NEWGRF_CLASS_H 13 #define NEWGRF_CLASS_H 20 template <
typename Tspec,
typename T
id, T
id Tmax>
43 void Insert(Tspec *spec);
49 int GetUIFromIndex(
int index)
const;
50 int GetIndexFromUI(
int ui_index)
const;
52 const Tspec *GetSpec(uint index)
const;
58 static Tid Allocate(uint32 global_id);
59 static void Assign(Tspec *spec);
60 static uint GetClassCount();
61 static uint GetUIClassCount();
62 static Tid GetUIClass(uint index);
65 static const Tspec *GetByGrf(uint32 grfid, byte local_id,
int *index);
uint GetSpecCount() const
Get the number of allocated specs within the class.
bool IsUIAvailable(uint index) const
Check whether the spec will be available to the user at some point in time.
uint GetUISpecCount() const
Get the number of potentially user-available specs within the class.
Struct containing information relating to NewGRF classes for stations and airports.
uint32 StringID
Numeric value that represents a string, independent of the selected language.
uint32 global_id
Global ID for class, e.g. 'DFLT', 'WAYP', etc.
uint ui_count
Number of specs in this class potentially available to the user.
static NewGRFClass * Get(Tid cls_id)
Get a particular class.
static NewGRFClass< Tspec, Tid, Tmax > classes[Tmax]
The actual classes.
Tspec ** spec
Array of specifications.
uint count
Number of specs in this class.
static void InsertDefaults()
Initialise the defaults.
Types related to strings.
StringID name
Name of this class.