Bazaar developer reference

CvTeam::countNumUnitsByArea(CvArea *) const

Defined in
CvTeam.cpp, line 2336
Class
CvTeam
Hook name
CivHooks::CvTeam_countNumUnitsByArea

Hooks

static bool BeforeCvTeam_countNumUnitsByArea(const CvTeam* self, CvArea* pArea, int& result);static void AfterCvTeam_countNumUnitsByArea(const CvTeam* self, CvArea* pArea, int& result);static int ReplaceCvTeam_countNumUnitsByArea(int (*original)(const CvTeam*, CvArea*), const CvTeam* self, CvArea* pArea);CivRegisterBefore<CivHooks::CvTeam_countNumUnitsByArea>(host, &BeforeCvTeam_countNumUnitsByArea);CivRegisterAfter<CivHooks::CvTeam_countNumUnitsByArea>(host, &AfterCvTeam_countNumUnitsByArea);CivRegisterReplace<CivHooks::CvTeam_countNumUnitsByArea>(host, &ReplaceCvTeam_countNumUnitsByArea);

Code

2336int CvTeam::countNumUnitsByArea(CvArea* pArea) const2337{2338	int iCount;2339	int iI;23402341	iCount = 0;23422343	for(iI = 0; iI < MAX_PLAYERS; iI++)2344	{2345		CvPlayerAI& kPlayer = GET_PLAYER((PlayerTypes)iI);2346		if(kPlayer.isAlive())2347		{2348			if(kPlayer.getTeam() == m_eID)2349			{2350				iCount += pArea->getUnitsPerPlayer((PlayerTypes)iI);2351			}2352		}2353	}23542355	return iCount;2356}

Calls

Called by