Bazaar developer reference

CvPlot::isAdjacentTeam(TeamTypes, bool) const

Defined in
CvPlot.cpp, line 3241
Class
CvPlot
Hook name
CivHooks::CvPlot_isAdjacentTeam

Hooks

static bool BeforeCvPlot_isAdjacentTeam(const CvPlot* self, TeamTypes eTeam, bool bLandOnly, bool& result);static void AfterCvPlot_isAdjacentTeam(const CvPlot* self, TeamTypes eTeam, bool bLandOnly, bool& result);static bool ReplaceCvPlot_isAdjacentTeam(bool (*original)(const CvPlot*, TeamTypes, bool), const CvPlot* self, TeamTypes eTeam, bool bLandOnly);CivRegisterBefore<CivHooks::CvPlot_isAdjacentTeam>(host, &BeforeCvPlot_isAdjacentTeam);CivRegisterAfter<CivHooks::CvPlot_isAdjacentTeam>(host, &AfterCvPlot_isAdjacentTeam);CivRegisterReplace<CivHooks::CvPlot_isAdjacentTeam>(host, &ReplaceCvPlot_isAdjacentTeam);

Code

3241bool CvPlot::isAdjacentTeam(TeamTypes eTeam, bool bLandOnly) const3242{3243	CvPlot* pAdjacentPlot;3244	int iI;32453246	for(iI = 0; iI < NUM_DIRECTION_TYPES; ++iI)3247	{3248		pAdjacentPlot = plotDirection(getX(), getY(), ((DirectionTypes)iI));32493250		if(pAdjacentPlot != NULL)3251		{3252			if(pAdjacentPlot->getTeam() == eTeam)3253			{3254				if(!bLandOnly || !(pAdjacentPlot->isWater()))3255				{3256					return true;3257				}3258			}3259		}3260	}32613262	return false;3263}

Calls

Called by