Bazaar developer reference

CvTeam::countNumCitiesByArea(CvArea *) const

Defined in
CvTeam.cpp, line 2360
Class
CvTeam
Hook name
CivHooks::CvTeam_countNumCitiesByArea

Hooks

static bool BeforeCvTeam_countNumCitiesByArea(const CvTeam* self, CvArea* pArea, int& result);static void AfterCvTeam_countNumCitiesByArea(const CvTeam* self, CvArea* pArea, int& result);static int ReplaceCvTeam_countNumCitiesByArea(int (*original)(const CvTeam*, CvArea*), const CvTeam* self, CvArea* pArea);CivRegisterBefore<CivHooks::CvTeam_countNumCitiesByArea>(host, &BeforeCvTeam_countNumCitiesByArea);CivRegisterAfter<CivHooks::CvTeam_countNumCitiesByArea>(host, &AfterCvTeam_countNumCitiesByArea);CivRegisterReplace<CivHooks::CvTeam_countNumCitiesByArea>(host, &ReplaceCvTeam_countNumCitiesByArea);

Code

2360int CvTeam::countNumCitiesByArea(CvArea* pArea) const2361{2362	int iCount;2363	int iI;23642365	iCount = 0;23662367	for(iI = 0; iI < MAX_PLAYERS; iI++)2368	{2369		CvPlayerAI& kPlayer = GET_PLAYER((PlayerTypes)iI);2370		if(kPlayer.isAlive())2371		{2372			if(kPlayer.getTeam() == m_eID)2373			{2374				iCount += pArea->getCitiesPerPlayer((PlayerTypes)iI);2375			}2376		}2377	}23782379	return iCount;2380}

Calls

Called by