Go to the documentation of this file.
10 #ifndef NEWGRF_CLASS_H
11 #define NEWGRF_CLASS_H
18 template <
typename Tspec,
typename T
id, T
id Tmax>
41 void Insert(Tspec *
spec);
47 int GetUIFromIndex(
int index)
const;
48 int GetIndexFromUI(
int ui_index)
const;
50 const Tspec *GetSpec(uint index)
const;
57 static void Assign(Tspec *
spec);
58 static uint GetClassCount();
59 static uint GetUIClassCount();
60 static Tid GetUIClass(uint index);
63 static const Tspec *GetByGrf(uint32 grfid,
byte local_id,
int *index);
uint GetUISpecCount() const
Get the number of potentially user-available specs within the class.
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.
uint32 global_id
Global ID for class, e.g. 'DFLT', 'WAYP', etc.
Struct containing information relating to NewGRF classes for stations and airports.
uint count
Number of specs in this class.
uint ui_count
Number of specs in this class potentially available to the user.
static void InsertDefaults()
Initialise the defaults.
uint32 StringID
Numeric value that represents a string, independent of the selected language.
StringID name
Name of this class.
static NewGRFClass< Tspec, Tid, Tmax > classes[Tmax]
The actual classes.
static NewGRFClass * Get(Tid cls_id)
Get a particular class.
Tspec ** spec
Array of specifications.