Bazaar developer reference

CvPlayerPolicies::GetNumPolicyBranchesUnlocked() const

Defined in
CvPolicyClasses.cpp, line 3863
Class
CvPlayerPolicies
Hook name
CivHooks::CvPlayerPolicies_GetNumPolicyBranchesUnlocked

Hooks

static bool BeforeCvPlayerPolicies_GetNumPolicyBranchesUnlocked(const CvPlayerPolicies* self, int& result);static void AfterCvPlayerPolicies_GetNumPolicyBranchesUnlocked(const CvPlayerPolicies* self, int& result);static int ReplaceCvPlayerPolicies_GetNumPolicyBranchesUnlocked(int (*original)(const CvPlayerPolicies*), const CvPlayerPolicies* self);CivRegisterBefore<CivHooks::CvPlayerPolicies_GetNumPolicyBranchesUnlocked>(host, &BeforeCvPlayerPolicies_GetNumPolicyBranchesUnlocked);CivRegisterAfter<CivHooks::CvPlayerPolicies_GetNumPolicyBranchesUnlocked>(host, &AfterCvPlayerPolicies_GetNumPolicyBranchesUnlocked);CivRegisterReplace<CivHooks::CvPlayerPolicies_GetNumPolicyBranchesUnlocked>(host, &ReplaceCvPlayerPolicies_GetNumPolicyBranchesUnlocked);

Code

3862/// Accessor: how many branches has this player unlocked?3863int CvPlayerPolicies::GetNumPolicyBranchesUnlocked() const3864{3865	int iCount = 0;38663867	for(int iBranchLoop = 0; iBranchLoop < m_pPolicies->GetNumPolicyBranches(); iBranchLoop++)3868	{3869		if(IsPolicyBranchUnlocked((PolicyBranchTypes) iBranchLoop))3870		{3871			iCount++;3872		}3873	}38743875	return iCount;3876}

Calls

Called by