Bazaar developer reference

CvGameReligions::GetNumReligionsFounded(bool) const

Defined in
CvReligionClasses.cpp, line 2026
Class
CvGameReligions
Hook name
CivHooks::CvGameReligions_GetNumReligionsFounded

Hooks

static bool BeforeCvGameReligions_GetNumReligionsFounded(const CvGameReligions* self, bool bIgnoreLocal, int& result);static void AfterCvGameReligions_GetNumReligionsFounded(const CvGameReligions* self, bool bIgnoreLocal, int& result);static int ReplaceCvGameReligions_GetNumReligionsFounded(int (*original)(const CvGameReligions*, bool), const CvGameReligions* self, bool bIgnoreLocal);CivRegisterBefore<CivHooks::CvGameReligions_GetNumReligionsFounded>(host, &BeforeCvGameReligions_GetNumReligionsFounded);CivRegisterAfter<CivHooks::CvGameReligions_GetNumReligionsFounded>(host, &AfterCvGameReligions_GetNumReligionsFounded);CivRegisterReplace<CivHooks::CvGameReligions_GetNumReligionsFounded>(host, &ReplaceCvGameReligions_GetNumReligionsFounded);

Code

2024/// Number of religions founded so far (does not include pantheons)2025#if defined(MOD_RELIGION_LOCAL_RELIGIONS)2026int CvGameReligions::GetNumReligionsFounded(bool bIgnoreLocal) const2027#else2028int CvGameReligions::GetNumReligionsFounded() const2029#endif2030{2031	int iRtnValue = 0;20322033	ReligionList::const_iterator it;2034	for(it = m_CurrentReligions.begin(); it != m_CurrentReligions.end(); it++)2035	{2036		if(!it->m_bPantheon)2037		{2038#if defined(MOD_RELIGION_LOCAL_RELIGIONS)2039			if (MOD_RELIGION_LOCAL_RELIGIONS && bIgnoreLocal && GC.getReligionInfo(it->m_eReligion)->IsLocalReligion()) {2040				continue;2041			}2042#endif20432044			iRtnValue++;2045		}2046	}20472048	return iRtnValue;2049}

Calls

Called by