Bazaar developer reference

CvTeam::countTotalPopulationByArea(CvArea *) const

Defined in
CvTeam.cpp, line 2384
Class
CvTeam
Hook name
CivHooks::CvTeam_countTotalPopulationByArea

Hooks

static bool BeforeCvTeam_countTotalPopulationByArea(const CvTeam* self, CvArea* pArea, int& result);static void AfterCvTeam_countTotalPopulationByArea(const CvTeam* self, CvArea* pArea, int& result);static int ReplaceCvTeam_countTotalPopulationByArea(int (*original)(const CvTeam*, CvArea*), const CvTeam* self, CvArea* pArea);CivRegisterBefore<CivHooks::CvTeam_countTotalPopulationByArea>(host, &BeforeCvTeam_countTotalPopulationByArea);CivRegisterAfter<CivHooks::CvTeam_countTotalPopulationByArea>(host, &AfterCvTeam_countTotalPopulationByArea);CivRegisterReplace<CivHooks::CvTeam_countTotalPopulationByArea>(host, &ReplaceCvTeam_countTotalPopulationByArea);

Code

2384int CvTeam::countTotalPopulationByArea(CvArea* pArea) const2385{2386	int iCount;2387	int iI;23882389	iCount = 0;23902391	for(iI = 0; iI < MAX_PLAYERS; iI++)2392	{2393		CvPlayerAI& kPlayer = GET_PLAYER((PlayerTypes)iI);2394		if(kPlayer.isAlive())2395		{2396			if(kPlayer.getTeam() == m_eID)2397			{2398				iCount += pArea->getPopulationPerPlayer((PlayerTypes)iI);2399			}2400		}2401	}24022403	return iCount;2404}

Calls

Called by