Bazaar developer reference

CvCity::getWorkPlotDistance(int) const

Defined in
CvCity.cpp, line 2235
Class
CvCity
Hook name
CivHooks::CvCity_getWorkPlotDistance

Hooks

static bool BeforeCvCity_getWorkPlotDistance(const CvCity* self, int iChange, int& result);static void AfterCvCity_getWorkPlotDistance(const CvCity* self, int iChange, int& result);static int ReplaceCvCity_getWorkPlotDistance(int (*original)(const CvCity*, int), const CvCity* self, int iChange);CivRegisterBefore<CivHooks::CvCity_getWorkPlotDistance>(host, &BeforeCvCity_getWorkPlotDistance);CivRegisterAfter<CivHooks::CvCity_getWorkPlotDistance>(host, &AfterCvCity_getWorkPlotDistance);CivRegisterReplace<CivHooks::CvCity_getWorkPlotDistance>(host, &ReplaceCvCity_getWorkPlotDistance);

Code

2234/// How far out this city may buy/work plots2235int CvCity::getWorkPlotDistance(int iChange) const2236{2237	int iDistance = GET_PLAYER(getOwner()).getWorkPlotDistance();2238	2239	// Change distance based on buildings/wonders in this city2240	iDistance += GetCityWorkingChange();2241	2242	iDistance = std::min(MAX_CITY_RADIUS, std::max(MIN_CITY_RADIUS, iDistance+iChange));2243	return iDistance;2244}

Calls

Called by