Bazaar developer reference

CvPlot::plotCount(ConstPlotUnitFunc, int, int, PlayerTypes, TeamTypes, ConstPlotUnitFunc, int, int) const

Defined in
CvPlot.cpp, line 3404
Class
CvPlot
Hook name
CivHooks::CvPlot_plotCount

Hooks

static bool BeforeCvPlot_plotCount(const CvPlot* self, ConstPlotUnitFunc funcA, int iData1A, int iData2A, PlayerTypes eOwner, TeamTypes eTeam, ConstPlotUnitFunc funcB, int iData1B, int iData2B, int& result);static void AfterCvPlot_plotCount(const CvPlot* self, ConstPlotUnitFunc funcA, int iData1A, int iData2A, PlayerTypes eOwner, TeamTypes eTeam, ConstPlotUnitFunc funcB, int iData1B, int iData2B, int& result);static int ReplaceCvPlot_plotCount(int (*original)(const CvPlot*, ConstPlotUnitFunc, int, int, PlayerTypes, TeamTypes, ConstPlotUnitFunc, int, int), const CvPlot* self, ConstPlotUnitFunc funcA, int iData1A, int iData2A, PlayerTypes eOwner, TeamTypes eTeam, ConstPlotUnitFunc funcB, int iData1B, int iData2B);CivRegisterBefore<CivHooks::CvPlot_plotCount>(host, &BeforeCvPlot_plotCount);CivRegisterAfter<CivHooks::CvPlot_plotCount>(host, &AfterCvPlot_plotCount);CivRegisterReplace<CivHooks::CvPlot_plotCount>(host, &ReplaceCvPlot_plotCount);

Code

3404int CvPlot::plotCount(ConstPlotUnitFunc funcA, int iData1A, int iData2A, PlayerTypes eOwner, TeamTypes eTeam, ConstPlotUnitFunc funcB, int iData1B, int iData2B) const3405{3406	const IDInfo* pUnitNode;3407	const CvUnit* pLoopUnit;3408	int iCount;34093410	iCount = 0;34113412	pUnitNode = headUnitNode();34133414	while(pUnitNode != NULL)3415	{3416		pLoopUnit = GetPlayerUnit(*pUnitNode);3417		pUnitNode = nextUnitNode(pUnitNode);34183419		if(pLoopUnit)3420		{3421			if((eOwner == NO_PLAYER) || (pLoopUnit->getOwner() == eOwner))3422			{3423				if((eTeam == NO_TEAM) || (pLoopUnit->getTeam() == eTeam))3424				{3425					if((funcA == NULL) || funcA(pLoopUnit, iData1A, iData2A))3426					{3427						if((funcB == NULL) || funcB(pLoopUnit, iData1B, iData2B))3428						{3429							iCount++;3430						}3431					}3432				}3433			}3434		}3435	}34363437	return iCount;3438}

Calls

Called by