Bazaar developer reference

CvCity::changeCityWorkingChange(int)

Defined in
CvCity.cpp, line 9059
Class
CvCity
Hook name
CivHooks::CvCity_changeCityWorkingChange

Hooks

static bool BeforeCvCity_changeCityWorkingChange(CvCity* self, int iChange);static void AfterCvCity_changeCityWorkingChange(CvCity* self, int iChange);static void ReplaceCvCity_changeCityWorkingChange(void (*original)(CvCity*, int), CvCity* self, int iChange);CivRegisterBefore<CivHooks::CvCity_changeCityWorkingChange>(host, &BeforeCvCity_changeCityWorkingChange);CivRegisterAfter<CivHooks::CvCity_changeCityWorkingChange>(host, &AfterCvCity_changeCityWorkingChange);CivRegisterReplace<CivHooks::CvCity_changeCityWorkingChange>(host, &ReplaceCvCity_changeCityWorkingChange);

Code

9059void CvCity::changeCityWorkingChange(int iChange)9060{9061	VALIDATE_OBJECT9062	if(iChange != 0)9063	{9064		int iOldPlots = GetNumWorkablePlots();9065		m_iCityWorkingChange = (m_iCityWorkingChange + iChange);9066		int iNewPlots = GetNumWorkablePlots();9067			9068		for (int iI = std::min(iOldPlots, iNewPlots); iI < std::max(iOldPlots, iNewPlots); ++iI) {9069			CvPlot* pLoopPlot = plotCity(getX(), getY(), iI);90709071			if (pLoopPlot) {9072				pLoopPlot->changeCityRadiusCount(iChange);9073				pLoopPlot->changePlayerCityRadiusCount(getOwner(), iChange);9074			}9075		}9076	}9077}

Calls

Called by