CvCity::changePopulation(int, bool)
- Defined in
- CvCity.cpp, line 7956
- Class
- CvCity
- Hook name
CivHooks::CvCity_changePopulation
Hooks
static bool BeforeCvCity_changePopulation(CvCity* self, int iChange, bool bReassignPop);static void AfterCvCity_changePopulation(CvCity* self, int iChange, bool bReassignPop);static void ReplaceCvCity_changePopulation(void (*original)(CvCity*, int, bool), CvCity* self, int iChange, bool bReassignPop);CivRegisterBefore<CivHooks::CvCity_changePopulation>(host, &BeforeCvCity_changePopulation);CivRegisterAfter<CivHooks::CvCity_changePopulation>(host, &AfterCvCity_changePopulation);CivRegisterReplace<CivHooks::CvCity_changePopulation>(host, &ReplaceCvCity_changePopulation);
Code
7953// Be very careful with setting bReassignPop to false. This assumes that the caller7954// is manually adjusting the worker assignments *and* handling the setting of7955// the CityCitizens unassigned worker value.7956void CvCity::changePopulation(int iChange, bool bReassignPop)7957{7958 VALIDATE_OBJECT7959 setPopulation(getPopulation() + iChange, bReassignPop);79607961 // Update the religious system7962 GetCityReligions()->DoPopulationChange(iChange);7963}
Calls
Called by
- CvCity::DoRazingTurn()
- CvCity::conscript()
- CvCity::doGrowth()
- CvCity::hurry(HurryTypes)
- CvCity::init(int, PlayerTypes, int, int, bool, bool, ReligionTypes, const char *)
- CvCityCitizens::DoRemoveAllSpecialistsFromBuilding(BuildingTypes, bool)
- CvCityCitizens::DoRemoveSpecialistFromBuilding(BuildingTypes, bool, bool)
- CvPlayer::doAdvancedStartAction(AdvancedStartActionTypes, int, int, int, bool)
- CvPlayer::receiveGoody(CvPlot *, GoodyTypes, CvUnit *)
- CvUnitCombat::ApplyNuclearExplosionDamage(const CvCombatMemberEntry *, int, CvUnit *, CvPlot *, int)
- CvLuaCity::lChangePopulation(lua_State *)