Bazaar developer reference

CvCity::getConscriptPopulation() const

Defined in
CvCity.cpp, line 6116
Class
CvCity
Hook name
CivHooks::CvCity_getConscriptPopulation

Hooks

static bool BeforeCvCity_getConscriptPopulation(const CvCity* self, int& result);static void AfterCvCity_getConscriptPopulation(const CvCity* self, int& result);static int ReplaceCvCity_getConscriptPopulation(int (*original)(const CvCity*), const CvCity* self);CivRegisterBefore<CivHooks::CvCity_getConscriptPopulation>(host, &BeforeCvCity_getConscriptPopulation);CivRegisterAfter<CivHooks::CvCity_getConscriptPopulation>(host, &AfterCvCity_getConscriptPopulation);CivRegisterReplace<CivHooks::CvCity_getConscriptPopulation>(host, &ReplaceCvCity_getConscriptPopulation);

Code

6116int CvCity::getConscriptPopulation() const6117{6118	VALIDATE_OBJECT6119	UnitTypes eConscriptUnit = getConscriptUnit();61206121	if(eConscriptUnit == NO_UNIT)6122	{6123		return 0;6124	}61256126	CvUnitEntry* pkUnitInfo = GC.getUnitInfo(eConscriptUnit);6127	if(pkUnitInfo == NULL)6128	{6129		return 0;6130	}61316132	int iConscriptPopulationPerCost = GC.getCONSCRIPT_POPULATION_PER_COST();6133	if(iConscriptPopulationPerCost == 0)6134	{6135		return 0;6136	}61376138	return std::max(1, ((pkUnitInfo->GetProductionCost()) / iConscriptPopulationPerCost));6139}

Calls

Called by