Bazaar developer reference

CvPlot::isBestAdjacentFound(PlayerTypes)

Defined in
CvPlot.cpp, line 8665
Class
CvPlot
Hook name
CivHooks::CvPlot_isBestAdjacentFound

Hooks

static bool BeforeCvPlot_isBestAdjacentFound(CvPlot* self, PlayerTypes eIndex, bool& result);static void AfterCvPlot_isBestAdjacentFound(CvPlot* self, PlayerTypes eIndex, bool& result);static bool ReplaceCvPlot_isBestAdjacentFound(bool (*original)(CvPlot*, PlayerTypes), CvPlot* self, PlayerTypes eIndex);CivRegisterBefore<CivHooks::CvPlot_isBestAdjacentFound>(host, &BeforeCvPlot_isBestAdjacentFound);CivRegisterAfter<CivHooks::CvPlot_isBestAdjacentFound>(host, &AfterCvPlot_isBestAdjacentFound);CivRegisterReplace<CivHooks::CvPlot_isBestAdjacentFound>(host, &ReplaceCvPlot_isBestAdjacentFound);

Code

8665bool CvPlot::isBestAdjacentFound(PlayerTypes eIndex)8666{8667	CvPlot* pAdjacentPlot;8668	int iI;86698670	CvPlayer& thisPlayer = GET_PLAYER(eIndex);8671	int iPlotValue = thisPlayer.AI_foundValue(getX(), getY());86728673	if(iPlotValue == 0)8674	{8675		return false;8676	}86778678	for(iI = 0; iI < NUM_DIRECTION_TYPES; ++iI)8679	{8680		pAdjacentPlot = plotDirection(getX(), getY(), ((DirectionTypes)iI));86818682		if((pAdjacentPlot != NULL) && pAdjacentPlot->isRevealed(thisPlayer.getTeam()))8683		{8684			if(thisPlayer.AI_foundValue(pAdjacentPlot->getX(), pAdjacentPlot->getY()) > iPlotValue)8685			{8686				return false;8687			}8688		}8689	}86908691	return true;8692}

Calls

Called by