Bazaar developer reference

CvReligionAI::AreAllOurCitiesConverted(ReligionTypes, bool) const

Defined in
CvReligionClasses.cpp, line 6840
Class
CvReligionAI
Hook name
CivHooks::CvReligionAI_AreAllOurCitiesConverted

Hooks

static bool BeforeCvReligionAI_AreAllOurCitiesConverted(const CvReligionAI* self, ReligionTypes eReligion, bool bIncludePuppets, bool& result);static void AfterCvReligionAI_AreAllOurCitiesConverted(const CvReligionAI* self, ReligionTypes eReligion, bool bIncludePuppets, bool& result);static bool ReplaceCvReligionAI_AreAllOurCitiesConverted(bool (*original)(const CvReligionAI*, ReligionTypes, bool), const CvReligionAI* self, ReligionTypes eReligion, bool bIncludePuppets);CivRegisterBefore<CivHooks::CvReligionAI_AreAllOurCitiesConverted>(host, &BeforeCvReligionAI_AreAllOurCitiesConverted);CivRegisterAfter<CivHooks::CvReligionAI_AreAllOurCitiesConverted>(host, &AfterCvReligionAI_AreAllOurCitiesConverted);CivRegisterReplace<CivHooks::CvReligionAI_AreAllOurCitiesConverted>(host, &ReplaceCvReligionAI_AreAllOurCitiesConverted);

Code

6839/// Are all of our own cities our religion?6840bool CvReligionAI::AreAllOurCitiesConverted(ReligionTypes eReligion, bool bIncludePuppets) const6841{6842	bool bRtnValue = true;68436844	int iLoop;6845	CvCity* pLoopCity;6846	for(pLoopCity = m_pPlayer->firstCity(&iLoop); pLoopCity != NULL; pLoopCity = m_pPlayer->nextCity(&iLoop))6847	{6848		if(pLoopCity->GetCityReligions()->GetReligiousMajority() != eReligion)6849		{6850			if(bIncludePuppets || !pLoopCity->IsPuppet())6851			{6852				bRtnValue = false;6853				break;6854			}6855		}6856	}68576858	return bRtnValue;6859}

Calls

Called by