CvPlayer::GetNumCitiesWithStateReligion()
- Defined in
- CvPlayer.cpp, line 27185
- Class
- CvPlayer
- Hook name
CivHooks::CvPlayer_GetNumCitiesWithStateReligion
Hooks
static bool BeforeCvPlayer_GetNumCitiesWithStateReligion(CvPlayer* self, int& result);static void AfterCvPlayer_GetNumCitiesWithStateReligion(CvPlayer* self, int& result);static int ReplaceCvPlayer_GetNumCitiesWithStateReligion(int (*original)(CvPlayer*), CvPlayer* self);CivRegisterBefore<CivHooks::CvPlayer_GetNumCitiesWithStateReligion>(host, &BeforeCvPlayer_GetNumCitiesWithStateReligion);CivRegisterAfter<CivHooks::CvPlayer_GetNumCitiesWithStateReligion>(host, &AfterCvPlayer_GetNumCitiesWithStateReligion);CivRegisterReplace<CivHooks::CvPlayer_GetNumCitiesWithStateReligion>(host, &ReplaceCvPlayer_GetNumCitiesWithStateReligion);
Code
27184/// Number of Cities in the empire with our State Religion27185int CvPlayer::GetNumCitiesWithStateReligion()27186{27187 int iNumCitiesWithStateReligion = 0;2718827189 int iLoopCity;27190 CvCity* pLoopCity = NULL;27191 // Look at all of our Cities to see if they have our Religion27192 for(pLoopCity = firstCity(&iLoopCity); pLoopCity != NULL; pLoopCity = nextCity(&iLoopCity))27193 {27194 if(pLoopCity->GetPlayersReligion() == GetID())27195 {27196 iNumCitiesWithStateReligion++;27197 }27198 }2719927200 return iNumCitiesWithStateReligion;27201}