Bazaar developer reference

CvPlot::IsWithinDistanceOfPlotType(PlotTypes, int) const

Defined in
CvPlot.cpp, line 12015
Class
CvPlot
Hook name
CivHooks::CvPlot_IsWithinDistanceOfPlotType

Hooks

static bool BeforeCvPlot_IsWithinDistanceOfPlotType(const CvPlot* self, PlotTypes iPlotType, int iDistance, bool& result);static void AfterCvPlot_IsWithinDistanceOfPlotType(const CvPlot* self, PlotTypes iPlotType, int iDistance, bool& result);static bool ReplaceCvPlot_IsWithinDistanceOfPlotType(bool (*original)(const CvPlot*, PlotTypes, int), const CvPlot* self, PlotTypes iPlotType, int iDistance);CivRegisterBefore<CivHooks::CvPlot_IsWithinDistanceOfPlotType>(host, &BeforeCvPlot_IsWithinDistanceOfPlotType);CivRegisterAfter<CivHooks::CvPlot_IsWithinDistanceOfPlotType>(host, &AfterCvPlot_IsWithinDistanceOfPlotType);CivRegisterReplace<CivHooks::CvPlot_IsWithinDistanceOfPlotType>(host, &ReplaceCvPlot_IsWithinDistanceOfPlotType);

Code

12015bool CvPlot::IsWithinDistanceOfPlotType(PlotTypes iPlotType, int iDistance) const12016{12017	int iX = getX(); int iY = getY();1201812019	for (int i = -iDistance; i <= iDistance; ++i) {12020		for (int j = -iDistance; j <= iDistance; ++j) {12021			CvPlot* pLoopPlot = ::plotXYWithRangeCheck(iX, iY, i, j, iDistance);12022		12023			if (pLoopPlot != NULL && pLoopPlot->HasPlotType(iPlotType)) {12024				return true;12025			}12026		}12027	}1202812029	return false;12030}

Calls

Called by