(svn r24685) -Codechange: Add resolver classes for rail types.

This commit is contained in:
alberth
2012-11-10 20:41:45 +00:00
parent 87122038fc
commit a2fe66cc02
5 changed files with 62 additions and 67 deletions

View File

@@ -398,7 +398,14 @@ class NIHRailType : public NIHelper {
const void *GetSpec(uint index) const { return NULL; }
void SetStringParameters(uint index) const { this->SetObjectAtStringParameters(STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_RAIL_TYPE, INVALID_STRING_ID, index); }
uint32 GetGRFID(uint index) const { return 0; }
void Resolve(ResolverObject *ro, uint32 index) const { extern void GetRailTypeResolver(ResolverObject *ro, uint index); GetRailTypeResolver(ro, index); }
/* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const
{
/* There is no unique GRFFile for the tile. Multiple GRFs can define different parts of the railtype.
* However, currently the NewGRF Debug GUI does not display variables depending on the GRF (like 0x7F) anyway. */
RailTypeResolverObject ro(index, TCX_NORMAL, NULL);
return ro.GetScope(ro.scope)->GetVariable(var, param, avail);
}
};
static const NIFeature _nif_railtype = {