Add function to get name of extended variable ID

Add table for internal variable IDs which aren't mappable externally
This commit is contained in:
Jonathan G Rennison
2023-06-01 19:26:45 +01:00
parent bdb9a72aa4
commit f7964cb3aa
5 changed files with 68 additions and 35 deletions

View File

@@ -209,6 +209,22 @@ struct GRFVariableMapDefinition {
{}
};
struct GRFNameOnlyVariableMapDefinition {
const char *name; // nullptr indicates the end of the list
int id;
/** Create empty object used to identify the end of a list. */
GRFNameOnlyVariableMapDefinition() :
name(nullptr),
id(0)
{}
GRFNameOnlyVariableMapDefinition(int id, const char *name) :
name(name),
id(id)
{}
};
struct GRFVariableMapEntry {
uint16 id = 0;
uint8 feature = 0;
@@ -450,4 +466,6 @@ const char *GetFeatureString(GrfSpecFeature feature);
void InitGRFGlobalVars();
const char *GetExtendedVariableNameById(int id);
#endif /* NEWGRF_H */