Bazaar developer reference

CvPlot::GetNumAdjacentMountains() const

Defined in
CvPlot.cpp, line 3355
Class
CvPlot
Hook name
CivHooks::CvPlot_GetNumAdjacentMountains

Hooks

static bool BeforeCvPlot_GetNumAdjacentMountains(const CvPlot* self, int& result);static void AfterCvPlot_GetNumAdjacentMountains(const CvPlot* self, int& result);static int ReplaceCvPlot_GetNumAdjacentMountains(int (*original)(const CvPlot*), const CvPlot* self);CivRegisterBefore<CivHooks::CvPlot_GetNumAdjacentMountains>(host, &BeforeCvPlot_GetNumAdjacentMountains);CivRegisterAfter<CivHooks::CvPlot_GetNumAdjacentMountains>(host, &AfterCvPlot_GetNumAdjacentMountains);CivRegisterReplace<CivHooks::CvPlot_GetNumAdjacentMountains>(host, &ReplaceCvPlot_GetNumAdjacentMountains);

Code

3355int CvPlot::GetNumAdjacentMountains() const3356{3357	CvPlot* pAdjacentPlot;3358	int iI;3359	int iNumMountains = 0;33603361	for (iI = 0; iI < NUM_DIRECTION_TYPES; ++iI)3362	{3363		pAdjacentPlot = plotDirection(getX(), getY(), ((DirectionTypes)iI));33643365		if(pAdjacentPlot != NULL)3366		{3367			if (pAdjacentPlot->isMountain())3368			{3369				iNumMountains++;3370			}3371		}3372	}3373	return iNumMountains;3374}

Calls

Called by