Bazaar developer reference

CvPlot::isAdjacentToArea(int) const

Defined in
CvPlot.cpp, line 897
Class
CvPlot
Hook name
CivHooks::CvPlot_isAdjacentToArea

Hooks

static bool BeforeCvPlot_isAdjacentToArea(const CvPlot* self, int iAreaID, bool& result);static void AfterCvPlot_isAdjacentToArea(const CvPlot* self, int iAreaID, bool& result);static bool ReplaceCvPlot_isAdjacentToArea(bool (*original)(const CvPlot*, int), const CvPlot* self, int iAreaID);CivRegisterBefore<CivHooks::CvPlot_isAdjacentToArea>(host, &BeforeCvPlot_isAdjacentToArea);CivRegisterAfter<CivHooks::CvPlot_isAdjacentToArea>(host, &AfterCvPlot_isAdjacentToArea);CivRegisterReplace<CivHooks::CvPlot_isAdjacentToArea>(host, &ReplaceCvPlot_isAdjacentToArea);

Code

897bool CvPlot::isAdjacentToArea(int iAreaID) const898{899900	CvPlot* pAdjacentPlot;901	int iI;902903	for(iI = 0; iI < NUM_DIRECTION_TYPES; ++iI)904	{905		pAdjacentPlot = plotDirection(getX(), getY(), ((DirectionTypes)iI));906907		if(pAdjacentPlot != NULL)908		{909			if(pAdjacentPlot->getArea() == iAreaID)910			{911				return true;912			}913		}914	}915916	return false;917}

Calls

Called by