Bazaar developer reference

CvPlayerReligions::GetReligionInMostCities() const

Defined in
CvReligionClasses.cpp, line 3234
Class
CvPlayerReligions
Hook name
CivHooks::CvPlayerReligions_GetReligionInMostCities

Hooks

static bool BeforeCvPlayerReligions_GetReligionInMostCities(const CvPlayerReligions* self, ReligionTypes& result);static void AfterCvPlayerReligions_GetReligionInMostCities(const CvPlayerReligions* self, ReligionTypes& result);static ReligionTypes ReplaceCvPlayerReligions_GetReligionInMostCities(ReligionTypes (*original)(const CvPlayerReligions*), const CvPlayerReligions* self);CivRegisterBefore<CivHooks::CvPlayerReligions_GetReligionInMostCities>(host, &BeforeCvPlayerReligions_GetReligionInMostCities);CivRegisterAfter<CivHooks::CvPlayerReligions_GetReligionInMostCities>(host, &AfterCvPlayerReligions_GetReligionInMostCities);CivRegisterReplace<CivHooks::CvPlayerReligions_GetReligionInMostCities>(host, &ReplaceCvPlayerReligions_GetReligionInMostCities);

Code

3233/// What religion is followed in a majority of our cities?3234ReligionTypes CvPlayerReligions::GetReligionInMostCities() const3235{3236	for (int iI = RELIGION_PANTHEON + 1; iI < GC.GetGameReligions()->GetNumReligions(); iI++)3237	{3238		ReligionTypes eReligion = (ReligionTypes)iI;3239		if (HasReligionInMostCities(eReligion))3240		{3241			return eReligion;3242		}3243	}3244	return NO_RELIGION;3245}

Calls

Called by