From 69e07c3e00180053cc087ceb1dfeb89845b79857 Mon Sep 17 00:00:00 2001 From: alberth Date: Sat, 10 Nov 2012 20:45:04 +0000 Subject: (svn r24691) -Codechange: Add resolver classes for vehicles. --- src/table/newgrf_debug_data.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/table') diff --git a/src/table/newgrf_debug_data.h b/src/table/newgrf_debug_data.h index 6ec8df40e..3cd9501d2 100644 --- a/src/table/newgrf_debug_data.h +++ b/src/table/newgrf_debug_data.h @@ -10,6 +10,7 @@ /** @file newgrf_debug_data.h Data 'tables' for NewGRF debugging. */ #include "../newgrf_house.h" +#include "../newgrf_engine.h" /* Helper for filling property tables */ #define NIP(prop, base, variable, type, name) { name, cpp_offsetof(base, variable), cpp_sizeof(base, variable), prop, type } @@ -69,7 +70,13 @@ class NIHVehicle : public NIHelper { const void *GetSpec(uint index) const { return Vehicle::Get(index)->GetEngine(); } void SetStringParameters(uint index) const { this->SetSimpleStringParameters(STR_VEHICLE_NAME, index); } uint32 GetGRFID(uint index) const { return Vehicle::Get(index)->GetGRFID(); } - void Resolve(ResolverObject *ro, uint32 index) const { extern void GetVehicleResolver(ResolverObject *ro, uint index); GetVehicleResolver(ro, index); } + + /* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const + { + Vehicle *v = Vehicle::Get(index); + VehicleResolverObject ro(v->engine_type, v); + return ro.GetScope(ro.scope)->GetVariable(var, param, avail); + } }; static const NIFeature _nif_vehicle = { -- cgit v1.2.3-70-g09d2