Bazaar developer reference

CvPlot::IsWithinDistanceOfFeature(FeatureTypes, int) const

Defined in
CvPlot.cpp, line 11951
Class
CvPlot
Hook name
CivHooks::CvPlot_IsWithinDistanceOfFeature

Hooks

static bool BeforeCvPlot_IsWithinDistanceOfFeature(const CvPlot* self, FeatureTypes iFeatureType, int iDistance, bool& result);static void AfterCvPlot_IsWithinDistanceOfFeature(const CvPlot* self, FeatureTypes iFeatureType, int iDistance, bool& result);static bool ReplaceCvPlot_IsWithinDistanceOfFeature(bool (*original)(const CvPlot*, FeatureTypes, int), const CvPlot* self, FeatureTypes iFeatureType, int iDistance);CivRegisterBefore<CivHooks::CvPlot_IsWithinDistanceOfFeature>(host, &BeforeCvPlot_IsWithinDistanceOfFeature);CivRegisterAfter<CivHooks::CvPlot_IsWithinDistanceOfFeature>(host, &AfterCvPlot_IsWithinDistanceOfFeature);CivRegisterReplace<CivHooks::CvPlot_IsWithinDistanceOfFeature>(host, &ReplaceCvPlot_IsWithinDistanceOfFeature);

Code

11951bool CvPlot::IsWithinDistanceOfFeature(FeatureTypes iFeatureType, int iDistance) const11952{11953	int iX = getX(); int iY = getY();1195411955	for (int i = -iDistance; i <= iDistance; ++i) {11956		for (int j = -iDistance; j <= iDistance; ++j) {11957			CvPlot* pLoopPlot = ::plotXYWithRangeCheck(iX, iY, i, j, iDistance);11958		11959			if (pLoopPlot != NULL && pLoopPlot->HasFeature(iFeatureType)) {11960				return true;11961			}11962		}11963	}1196411965	return false;11966}

Calls

Called by