Bazaar developer reference

CvPlayer::getAveragePopulation() const

Defined in
CvPlayer.cpp, line 10216
Class
CvPlayer
Hook name
CivHooks::CvPlayer_getAveragePopulation

Hooks

static bool BeforeCvPlayer_getAveragePopulation(const CvPlayer* self, int& result);static void AfterCvPlayer_getAveragePopulation(const CvPlayer* self, int& result);static int ReplaceCvPlayer_getAveragePopulation(int (*original)(const CvPlayer*), const CvPlayer* self);CivRegisterBefore<CivHooks::CvPlayer_getAveragePopulation>(host, &BeforeCvPlayer_getAveragePopulation);CivRegisterAfter<CivHooks::CvPlayer_getAveragePopulation>(host, &AfterCvPlayer_getAveragePopulation);CivRegisterReplace<CivHooks::CvPlayer_getAveragePopulation>(host, &ReplaceCvPlayer_getAveragePopulation);

Code

10216int CvPlayer::getAveragePopulation() const10217{10218	if(getNumCities() == 0)10219	{10220		return 0;10221	}1022210223	return ((getTotalPopulation() / getNumCities()) + 1);10224}

Calls

Called by