|
OpenTTD Source
14.0-beta3
|
Go to the documentation of this file.
10 #ifndef NEWGRF_CLASS_H
11 #define NEWGRF_CLASS_H
19 template <
typename Tspec,
typename T
id, T
id Tmax>
41 void Insert(Tspec *
spec);
44 uint
GetSpecCount()
const {
return static_cast<uint
>(this->spec.size()); }
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_t grfid, uint16_t 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.
uint32_t StringID
Numeric value that represents a string, independent of the selected language.
bool IsUIAvailable(uint index) const
Check whether the spec will be available to the user at some point in time.
Struct containing information relating to NewGRF classes for stations and airports.
uint ui_count
Number of specs in this class potentially available to the user.
static void InsertDefaults()
Initialise the defaults.
std::vector< Tspec * > spec
List of specifications.
uint32_t global_id
Global ID for class, e.g. 'DFLT', 'WAYP', etc.
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.