Bazaar developer reference

CvArea::getPopulationPerPlayer(PlayerTypes) const

Defined in
CvArea.cpp, line 423
Class
CvArea
Hook name
CivHooks::CvArea_getPopulationPerPlayer

Hooks

static bool BeforeCvArea_getPopulationPerPlayer(const CvArea* self, PlayerTypes eIndex, int& result);static void AfterCvArea_getPopulationPerPlayer(const CvArea* self, PlayerTypes eIndex, int& result);static int ReplaceCvArea_getPopulationPerPlayer(int (*original)(const CvArea*, PlayerTypes), const CvArea* self, PlayerTypes eIndex);CivRegisterBefore<CivHooks::CvArea_getPopulationPerPlayer>(host, &BeforeCvArea_getPopulationPerPlayer);CivRegisterAfter<CivHooks::CvArea_getPopulationPerPlayer>(host, &AfterCvArea_getPopulationPerPlayer);CivRegisterReplace<CivHooks::CvArea_getPopulationPerPlayer>(host, &ReplaceCvArea_getPopulationPerPlayer);

Code

422//	What is the population for the specified player in the area?423int CvArea::getPopulationPerPlayer(PlayerTypes eIndex) const424{425	CvAssertMsg(eIndex >= 0, "eIndex is expected to be >= 0");426	CvAssertMsg(eIndex < MAX_PLAYERS, "eIndex is expected to be < MAX_PLAYERS");427	if(eIndex < 0 || eIndex >= MAX_PLAYERS) return 0;428429	return m_aiPopulationPerPlayer[eIndex];430}

Called by