Bazaar developer reference

CvPlotManager::GetNumUnitsByIndex(int, int, int) const

Defined in
CvPlotManager.cpp, line 289
Class
CvPlotManager
Hook name
CivHooks::CvPlotManager_GetNumUnitsByIndex

Hooks

static bool BeforeCvPlotManager_GetNumUnitsByIndex(const CvPlotManager* self, int iX, int iY, int iLayerIndex, int& result);static void AfterCvPlotManager_GetNumUnitsByIndex(const CvPlotManager* self, int iX, int iY, int iLayerIndex, int& result);static int ReplaceCvPlotManager_GetNumUnitsByIndex(int (*original)(const CvPlotManager*, int, int, int), const CvPlotManager* self, int iX, int iY, int iLayerIndex);CivRegisterBefore<CivHooks::CvPlotManager_GetNumUnitsByIndex>(host, &BeforeCvPlotManager_GetNumUnitsByIndex);CivRegisterAfter<CivHooks::CvPlotManager_GetNumUnitsByIndex>(host, &AfterCvPlotManager_GetNumUnitsByIndex);CivRegisterReplace<CivHooks::CvPlotManager_GetNumUnitsByIndex>(host, &ReplaceCvPlotManager_GetNumUnitsByIndex);

Code

289int CvPlotManager::GetNumUnitsByIndex(int iX, int iY, int iLayerIndex) const290{291	if (iLayerIndex >= 0 && iLayerIndex < (int)m_aLayers.size())292	{293		const CvIDInfoFixedVector* pkEntry = m_aLayers[iLayerIndex].GetGrid()->Get(iX, iY);294		if (pkEntry)295			return (int)pkEntry->size();296	}297298	return 0;299}

Calls

Called by