Bazaar developer reference

CvPlot::shareAdjacentArea(const CvPlot *) const

Defined in
CvPlot.cpp, line 927
Class
CvPlot
Hook name
CivHooks::CvPlot_shareAdjacentArea

Hooks

static bool BeforeCvPlot_shareAdjacentArea(const CvPlot* self, const CvPlot* pPlot, bool& result);static void AfterCvPlot_shareAdjacentArea(const CvPlot* self, const CvPlot* pPlot, bool& result);static bool ReplaceCvPlot_shareAdjacentArea(bool (*original)(const CvPlot*, const CvPlot*), const CvPlot* self, const CvPlot* pPlot);CivRegisterBefore<CivHooks::CvPlot_shareAdjacentArea>(host, &BeforeCvPlot_shareAdjacentArea);CivRegisterAfter<CivHooks::CvPlot_shareAdjacentArea>(host, &AfterCvPlot_shareAdjacentArea);CivRegisterReplace<CivHooks::CvPlot_shareAdjacentArea>(host, &ReplaceCvPlot_shareAdjacentArea);

Code

927bool CvPlot::shareAdjacentArea(const CvPlot* pPlot) const928{929	int iCurrArea;930	int iLastArea;931	CvPlot* pAdjacentPlot;932	int iI;933934	iLastArea = FFreeList::INVALID_INDEX;935936	for(iI = 0; iI < NUM_DIRECTION_TYPES; ++iI)937	{938		pAdjacentPlot = plotDirection(getX(), getY(), ((DirectionTypes)iI));939940		if(pAdjacentPlot != NULL)941		{942			iCurrArea = pAdjacentPlot->getArea();943944			if(iCurrArea != iLastArea)945			{946				if(pPlot->isAdjacentToArea(iCurrArea))947				{948					return true;949				}950951				iLastArea = iCurrArea;952			}953		}954	}955956	return false;957}

Calls

Called by