Bazaar developer reference

CvCity::HasPlotType(PlotTypes) const

Defined in
CvCity.cpp, line 17346
Class
CvCity
Hook name
CivHooks::CvCity_HasPlotType

Hooks

static bool BeforeCvCity_HasPlotType(const CvCity* self, PlotTypes iPlotType, bool& result);static void AfterCvCity_HasPlotType(const CvCity* self, PlotTypes iPlotType, bool& result);static bool ReplaceCvCity_HasPlotType(bool (*original)(const CvCity*, PlotTypes), const CvCity* self, PlotTypes iPlotType);CivRegisterBefore<CivHooks::CvCity_HasPlotType>(host, &BeforeCvCity_HasPlotType);CivRegisterAfter<CivHooks::CvCity_HasPlotType>(host, &AfterCvCity_HasPlotType);CivRegisterReplace<CivHooks::CvCity_HasPlotType>(host, &ReplaceCvCity_HasPlotType);

Code

17346bool CvCity::HasPlotType(PlotTypes iPlotType) const17347{17348	int iX = getX(); int iY = getY(); int iOwner = getOwner();1734917350#if defined(MOD_GLOBAL_CITY_WORKING)17351	for (int iCityPlotLoop = 0; iCityPlotLoop < GetNumWorkablePlots(); iCityPlotLoop++)17352#else17353	for (int iCityPlotLoop = 0; iCityPlotLoop < NUM_CITY_PLOTS; iCityPlotLoop++)17354#endif17355	{17356		CvPlot* pLoopPlot = plotCity(iX, iY, iCityPlotLoop);1735717358		// Invalid plot or not owned by this player17359		if (pLoopPlot == NULL || pLoopPlot->getOwner() != iOwner) {17360			continue;17361		}1736217363		if (pLoopPlot->HasPlotType(iPlotType)) {17364			return true;17365		}17366	}1736717368	return false;17369}

Calls

Called by