summaryrefslogtreecommitdiff
path: root/src/table/newgrf_debug_data.h
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2012-11-10 20:40:05 +0000
committeralberth <alberth@openttd.org>2012-11-10 20:40:05 +0000
commitd7b62da87b5123907df008fffa8f21377c394358 (patch)
tree5fdf926ee465cfc99442f4a7c7313b2937eb1654 /src/table/newgrf_debug_data.h
parent0885a2370a45982a01abf314fc035c5a41ba6cfe (diff)
downloadopenttd-d7b62da87b5123907df008fffa8f21377c394358.tar.xz
(svn r24682) -Codechange: Add resolver classes for houses.
Diffstat (limited to 'src/table/newgrf_debug_data.h')
-rw-r--r--src/table/newgrf_debug_data.h9
1 files changed, 8 insertions, 1 deletions
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 = {