Bazaar developer reference

CvPlotManager::GetNumUnits(int, int, uint) const

Defined in
CvPlotManager.cpp, line 275
Class
CvPlotManager
Hook name
CivHooks::CvPlotManager_GetNumUnits

Hooks

static bool BeforeCvPlotManager_GetNumUnits(const CvPlotManager* self, int iX, int iY, uint uiLayerID, int& result);static void AfterCvPlotManager_GetNumUnits(const CvPlotManager* self, int iX, int iY, uint uiLayerID, int& result);static int ReplaceCvPlotManager_GetNumUnits(int (*original)(const CvPlotManager*, int, int, uint), const CvPlotManager* self, int iX, int iY, uint uiLayerID);CivRegisterBefore<CivHooks::CvPlotManager_GetNumUnits>(host, &BeforeCvPlotManager_GetNumUnits);CivRegisterAfter<CivHooks::CvPlotManager_GetNumUnits>(host, &AfterCvPlotManager_GetNumUnits);CivRegisterReplace<CivHooks::CvPlotManager_GetNumUnits>(host, &ReplaceCvPlotManager_GetNumUnits);

Code

275int CvPlotManager::GetNumUnits(int iX, int iY, uint uiLayerID) const276{277	const CvSparseIDInfoGrid* pkLayer = FindLayer(uiLayerID);278	if (pkLayer)279	{280		const CvIDInfoFixedVector* pkUnits = pkLayer->Get(iX, iY);281		if (pkUnits)282			return pkUnits->size();283	}284285	return 0;286}

Calls

Called by