Bazaar developer reference

CvGame::GetVariableCitySizeFromPopulation(unsigned int)

Defined in
CvGame.cpp, line 11970
Class
CvGame
Hook name
CivHooks::CvGame_GetVariableCitySizeFromPopulation

Hooks

static bool BeforeCvGame_GetVariableCitySizeFromPopulation(CvGame* self, unsigned int nPopulation, unsigned int& result);static void AfterCvGame_GetVariableCitySizeFromPopulation(CvGame* self, unsigned int nPopulation, unsigned int& result);static unsigned int ReplaceCvGame_GetVariableCitySizeFromPopulation(unsigned int (*original)(CvGame*, unsigned int), CvGame* self, unsigned int nPopulation);CivRegisterBefore<CivHooks::CvGame_GetVariableCitySizeFromPopulation>(host, &BeforeCvGame_GetVariableCitySizeFromPopulation);CivRegisterAfter<CivHooks::CvGame_GetVariableCitySizeFromPopulation>(host, &AfterCvGame_GetVariableCitySizeFromPopulation);CivRegisterReplace<CivHooks::CvGame_GetVariableCitySizeFromPopulation>(host, &ReplaceCvGame_GetVariableCitySizeFromPopulation);

Code

11969//Function to determine city size from city population11970unsigned int CvGame::GetVariableCitySizeFromPopulation(unsigned int nPopulation)11971{11972	for(unsigned int i = 0; i < 10; ++i)11973	{11974		if(nPopulation < ms_aiSizes[i])11975		{11976			return i;11977		}11978	}11979	return 4;11980}

Called by