diff options
author | alberth <alberth@openttd.org> | 2012-11-10 20:44:10 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2012-11-10 20:44:10 +0000 |
commit | f7352871fab18f1517df2c1e08abe13d3caacb96 (patch) | |
tree | af8636b2b93e614cbd130d11292cdb87d0a659de /src/table | |
parent | 348ef7f12c4ed2cfa7dd6bcbbf34a920e79dafc1 (diff) | |
download | openttd-f7352871fab18f1517df2c1e08abe13d3caacb96.tar.xz |
(svn r24689) -Codechange: Add resolver classes for industries.
Diffstat (limited to 'src/table')
-rw-r--r-- | src/table/newgrf_debug_data.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/table/newgrf_debug_data.h b/src/table/newgrf_debug_data.h index f843b592e..12a26aebd 100644 --- a/src/table/newgrf_debug_data.h +++ b/src/table/newgrf_debug_data.h @@ -308,7 +308,14 @@ class NIHIndustry : public NIHelper { const void *GetSpec(uint index) const { return GetIndustrySpec(Industry::Get(index)->type); } void SetStringParameters(uint index) const { this->SetSimpleStringParameters(STR_INDUSTRY_NAME, index); } uint32 GetGRFID(uint index) const { return (this->IsInspectable(index)) ? GetIndustrySpec(Industry::Get(index)->type)->grf_prop.grffile->grfid : 0; } - void Resolve(ResolverObject *ro, uint32 index) const { extern void GetIndustryResolver(ResolverObject *ro, uint index); GetIndustryResolver(ro, index); } + + /* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const + { + Industry *i = Industry::Get(index); + IndustriesResolverObject ro(i->location.tile, i, i->type); + return ro.GetScope(ro.scope)->GetVariable(var, param, avail); + } + uint GetPSASize(uint index, uint32 grfid) const { return cpp_lengthof(PersistentStorage, storage); } const int32 *GetPSAFirstPosition(uint index, uint32 grfid) const |