Bazaar developer reference

CvPlotManager::GetUnitsByIndex(int, int, int) const

Defined in
CvPlotManager.cpp, line 231
Class
CvPlotManager
Hook name
CivHooks::CvPlotManager_GetUnitsByIndex

Hooks

static bool BeforeCvPlotManager_GetUnitsByIndex(const CvPlotManager* self, int iX, int iY, int iLayerIndex, const CvIDInfoFixedVector*& result);static void AfterCvPlotManager_GetUnitsByIndex(const CvPlotManager* self, int iX, int iY, int iLayerIndex, const CvIDInfoFixedVector*& result);static const CvIDInfoFixedVector & ReplaceCvPlotManager_GetUnitsByIndex(const CvIDInfoFixedVector & (*original)(const CvPlotManager*, int, int, int), const CvPlotManager* self, int iX, int iY, int iLayerIndex);CivRegisterBefore<CivHooks::CvPlotManager_GetUnitsByIndex>(host, &BeforeCvPlotManager_GetUnitsByIndex);CivRegisterAfter<CivHooks::CvPlotManager_GetUnitsByIndex>(host, &AfterCvPlotManager_GetUnitsByIndex);CivRegisterReplace<CivHooks::CvPlotManager_GetUnitsByIndex>(host, &ReplaceCvPlotManager_GetUnitsByIndex);

Code

231const CvIDInfoFixedVector &CvPlotManager::GetUnitsByIndex(int iX, int iY, int iLayerIndex) const232{233	if (iLayerIndex >= 0 && iLayerIndex < (int)m_aLayers.size())234	{235		const CvIDInfoFixedVector* pkEntry = m_aLayers[iLayerIndex].GetGrid()->Get(iX, iY);236		if (pkEntry)237			return *pkEntry;238	}239240	return m_kEmpty;241}

Calls

Called by