CvPlayerReligions::GetNumForeignFollowers(bool) const
- Defined in
- CvReligionClasses.cpp, line 3331
- Class
- CvPlayerReligions
- Hook name
CivHooks::CvPlayerReligions_GetNumForeignFollowers
Hooks
static bool BeforeCvPlayerReligions_GetNumForeignFollowers(const CvPlayerReligions* self, bool bAtPeace, int& result);static void AfterCvPlayerReligions_GetNumForeignFollowers(const CvPlayerReligions* self, bool bAtPeace, int& result);static int ReplaceCvPlayerReligions_GetNumForeignFollowers(int (*original)(const CvPlayerReligions*, bool), const CvPlayerReligions* self, bool bAtPeace);CivRegisterBefore<CivHooks::CvPlayerReligions_GetNumForeignFollowers>(host, &BeforeCvPlayerReligions_GetNumForeignFollowers);CivRegisterAfter<CivHooks::CvPlayerReligions_GetNumForeignFollowers>(host, &AfterCvPlayerReligions_GetNumForeignFollowers);CivRegisterReplace<CivHooks::CvPlayerReligions_GetNumForeignFollowers>(host, &ReplaceCvPlayerReligions_GetNumForeignFollowers);
Code
3330/// How many foreign citizens are following a religion we founded?3331int CvPlayerReligions::GetNumForeignFollowers(bool bAtPeace) const3332{3333 CvCity *pLoopCity;3334 int iCityLoop;3335 int iRtnValue = 0;33363337 ReligionTypes eFounderBenefitReligion = GC.getGame().GetGameReligions()->GetFounderBenefitsReligion(m_pPlayer->GetID());3338 if (eFounderBenefitReligion > RELIGION_PANTHEON)3339 {3340 for(int iPlayerLoop = 0; iPlayerLoop < MAX_CIV_PLAYERS; iPlayerLoop++)3341 {3342 CvPlayer &kLoopPlayer = GET_PLAYER((PlayerTypes)iPlayerLoop);3343 if(kLoopPlayer.isAlive() && iPlayerLoop != m_pPlayer->GetID())3344 {3345 if (!bAtPeace || !atWar(m_pPlayer->getTeam(), kLoopPlayer.getTeam()))3346 {3347 for(pLoopCity = GET_PLAYER((PlayerTypes)iPlayerLoop).firstCity(&iCityLoop); pLoopCity != NULL; pLoopCity = GET_PLAYER((PlayerTypes)iPlayerLoop).nextCity(&iCityLoop))3348 {3349 iRtnValue += pLoopCity->GetCityReligions()->GetNumFollowers(eFounderBenefitReligion);3350 }3351 }3352 }3353 }3354 }33553356 return iRtnValue;3357}
Calls
- atWar(TeamTypes, TeamTypes)
- CvCity::GetCityReligions() const
- CvCityReligions::GetNumFollowers(ReligionTypes)
- CvGame::GetGameReligions()
- CvGameReligions::GetFounderBenefitsReligion(PlayerTypes) const
- CvGlobals::getGame()
- CvPlayer::firstCity(int *, bool)
- CvPlayer::GetID() const
- CvPlayer::getTeam() const
- CvPlayer::isAlive() const
- CvPlayer::nextCity(int *, bool)
- CvPlayerAI::getPlayer(PlayerTypes)