Bazaar developer reference

CvPlayer::countCitiesFeatureSurrounded() const

Defined in
CvPlayer.cpp, line 5757
Class
CvPlayer
Hook name
CivHooks::CvPlayer_countCitiesFeatureSurrounded

Hooks

static bool BeforeCvPlayer_countCitiesFeatureSurrounded(const CvPlayer* self, int& result);static void AfterCvPlayer_countCitiesFeatureSurrounded(const CvPlayer* self, int& result);static int ReplaceCvPlayer_countCitiesFeatureSurrounded(int (*original)(const CvPlayer*), const CvPlayer* self);CivRegisterBefore<CivHooks::CvPlayer_countCitiesFeatureSurrounded>(host, &BeforeCvPlayer_countCitiesFeatureSurrounded);CivRegisterAfter<CivHooks::CvPlayer_countCitiesFeatureSurrounded>(host, &AfterCvPlayer_countCitiesFeatureSurrounded);CivRegisterReplace<CivHooks::CvPlayer_countCitiesFeatureSurrounded>(host, &ReplaceCvPlayer_countCitiesFeatureSurrounded);

Code

5756/// How many cities in the empire surrounded by features?5757int CvPlayer::countCitiesFeatureSurrounded() const5758{5759	const CvCity* pLoopCity;5760	int iCount;5761	int iLoop;57625763	iCount = 0;57645765	for(pLoopCity = firstCity(&iLoop); pLoopCity != NULL; pLoopCity = nextCity(&iLoop))5766	{5767		if(pLoopCity->IsFeatureSurrounded())5768			iCount ++;5769	}57705771	return iCount;5772}

Calls

Called by