Bazaar developer reference

CvReligionBeliefs::IsFaithBuyingEnabled(EraTypes) const

Defined in
CvBeliefClasses.cpp, line 2156
Class
CvReligionBeliefs
Hook name
CivHooks::CvReligionBeliefs_IsFaithBuyingEnabled

Hooks

static bool BeforeCvReligionBeliefs_IsFaithBuyingEnabled(const CvReligionBeliefs* self, EraTypes eEra, bool& result);static void AfterCvReligionBeliefs_IsFaithBuyingEnabled(const CvReligionBeliefs* self, EraTypes eEra, bool& result);static bool ReplaceCvReligionBeliefs_IsFaithBuyingEnabled(bool (*original)(const CvReligionBeliefs*, EraTypes), const CvReligionBeliefs* self, EraTypes eEra);CivRegisterBefore<CivHooks::CvReligionBeliefs_IsFaithBuyingEnabled>(host, &BeforeCvReligionBeliefs_IsFaithBuyingEnabled);CivRegisterAfter<CivHooks::CvReligionBeliefs_IsFaithBuyingEnabled>(host, &AfterCvReligionBeliefs_IsFaithBuyingEnabled);CivRegisterReplace<CivHooks::CvReligionBeliefs_IsFaithBuyingEnabled>(host, &ReplaceCvReligionBeliefs_IsFaithBuyingEnabled);

Code

2155/// Is there a belief that allows faith buying of units2156bool CvReligionBeliefs::IsFaithBuyingEnabled(EraTypes eEra) const2157{2158	CvBeliefXMLEntries* pBeliefs = GC.GetGameBeliefs();21592160	for(int i = 0; i < pBeliefs->GetNumBeliefs(); i++)2161	{2162		if(HasBelief((BeliefTypes)i))2163		{2164			if (pBeliefs->GetEntry(i)->IsFaithUnitPurchaseEra((int)eEra))2165			{2166				return true;2167			}2168		}2169	}21702171	return false;2172}

Calls

Called by