Bazaar developer reference

CvPlot::isAdjacentPlayer(PlayerTypes, bool) const

Defined in
CvPlot.cpp, line 3192
Class
CvPlot
Hook name
CivHooks::CvPlot_isAdjacentPlayer

Hooks

static bool BeforeCvPlot_isAdjacentPlayer(const CvPlot* self, PlayerTypes ePlayer, bool bLandOnly, bool& result);static void AfterCvPlot_isAdjacentPlayer(const CvPlot* self, PlayerTypes ePlayer, bool bLandOnly, bool& result);static bool ReplaceCvPlot_isAdjacentPlayer(bool (*original)(const CvPlot*, PlayerTypes, bool), const CvPlot* self, PlayerTypes ePlayer, bool bLandOnly);CivRegisterBefore<CivHooks::CvPlot_isAdjacentPlayer>(host, &BeforeCvPlot_isAdjacentPlayer);CivRegisterAfter<CivHooks::CvPlot_isAdjacentPlayer>(host, &AfterCvPlot_isAdjacentPlayer);CivRegisterReplace<CivHooks::CvPlot_isAdjacentPlayer>(host, &ReplaceCvPlot_isAdjacentPlayer);

Code

3192bool CvPlot::isAdjacentPlayer(PlayerTypes ePlayer, bool bLandOnly) const3193{3194	CvPlot* pAdjacentPlot;3195	int iI;31963197	for(iI = 0; iI < NUM_DIRECTION_TYPES; ++iI)3198	{3199		pAdjacentPlot = plotDirection(getX(), getY(), ((DirectionTypes)iI));32003201		if(pAdjacentPlot != NULL)3202		{3203			if(pAdjacentPlot->getOwner() == ePlayer)3204			{3205				if(!bLandOnly || !(pAdjacentPlot->isWater()))3206				{3207					return true;3208				}3209			}3210		}3211	}32123213	return false;3214}

Calls

Called by