From d7b62da87b5123907df008fffa8f21377c394358 Mon Sep 17 00:00:00 2001 From: alberth Date: Sat, 10 Nov 2012 20:40:05 +0000 Subject: (svn r24682) -Codechange: Add resolver classes for houses. --- src/table/newgrf_debug_data.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/table/newgrf_debug_data.h') diff --git a/src/table/newgrf_debug_data.h b/src/table/newgrf_debug_data.h index 3ea83176d..c7f936587 100644 --- a/src/table/newgrf_debug_data.h +++ b/src/table/newgrf_debug_data.h @@ -9,6 +9,8 @@ /** @file newgrf_debug_data.h Data 'tables' for NewGRF debugging. */ +#include "../newgrf_house.h" + /* Helper for filling property tables */ #define NIP(prop, base, variable, type, name) { name, cpp_offsetof(base, variable), cpp_sizeof(base, variable), prop, type } #define NIP_END() { NULL, 0, 0, 0, 0 } @@ -184,7 +186,12 @@ class NIHHouse : public NIHelper { const void *GetSpec(uint index) const { return HouseSpec::Get(GetHouseType(index)); } void SetStringParameters(uint index) const { this->SetObjectAtStringParameters(STR_TOWN_NAME, GetTownIndex(index), index); } uint32 GetGRFID(uint index) const { return (this->IsInspectable(index)) ? HouseSpec::Get(GetHouseType(index))->grf_prop.grffile->grfid : 0; } - void Resolve(ResolverObject *ro, uint32 index) const { extern void GetHouseResolver(ResolverObject *ro, uint index); GetHouseResolver(ro, index); } + + /* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const + { + HouseResolverObject ro(GetHouseType(index), index, Town::GetByTile(index)); + return ro.GetScope(ro.scope)->GetVariable(var, param, avail); + } }; static const NIFeature _nif_house = { -- cgit v1.2.3-54-g00ecf