Bazaar developer reference

CvPlotManager::RemoveUnit(const IDInfo &, int, int, uint)

Defined in
CvPlotManager.cpp, line 254
Class
CvPlotManager
Hook name
CivHooks::CvPlotManager_RemoveUnit

Hooks

static bool BeforeCvPlotManager_RemoveUnit(CvPlotManager* self, const IDInfo& kInfo, int iX, int iY, uint uiLayerID);static void AfterCvPlotManager_RemoveUnit(CvPlotManager* self, const IDInfo& kInfo, int iX, int iY, uint uiLayerID);static void ReplaceCvPlotManager_RemoveUnit(void (*original)(CvPlotManager*, const IDInfo&, int, int, uint), CvPlotManager* self, const IDInfo& kInfo, int iX, int iY, uint uiLayerID);CivRegisterBefore<CivHooks::CvPlotManager_RemoveUnit>(host, &BeforeCvPlotManager_RemoveUnit);CivRegisterAfter<CivHooks::CvPlotManager_RemoveUnit>(host, &AfterCvPlotManager_RemoveUnit);CivRegisterReplace<CivHooks::CvPlotManager_RemoveUnit>(host, &ReplaceCvPlotManager_RemoveUnit);

Code

254void CvPlotManager::RemoveUnit(const IDInfo& kInfo, int iX, int iY, uint uiLayerID)255{256	if (uiLayerID != -1)257	{258		CvSparseIDInfoGrid* pkLayer = FindLayer(uiLayerID);259		if (pkLayer)260		{261			pkLayer->Remove(kInfo, iX, iY);262		}263	}264	else265	{266		int iIndex = 0;267		for (CvSparseIDInfoGridVector::const_iterator itr = m_aLayers.begin(); itr != m_aLayers.end(); ++itr)268		{269			(*itr).GetGrid()->Remove(kInfo, iX, iY);270		}271	}272}

Calls

Called by