Bazaar developer reference

CvPlayerPolicies::SetPolicyBranchChosen(int, PolicyBranchTypes)

Defined in
CvPolicyClasses.cpp, line 4277
Class
CvPlayerPolicies
Hook name
CivHooks::CvPlayerPolicies_SetPolicyBranchChosen

Hooks

static bool BeforeCvPlayerPolicies_SetPolicyBranchChosen(CvPlayerPolicies* self, int iID, PolicyBranchTypes eBranchType);static void AfterCvPlayerPolicies_SetPolicyBranchChosen(CvPlayerPolicies* self, int iID, PolicyBranchTypes eBranchType);static void ReplaceCvPlayerPolicies_SetPolicyBranchChosen(void (*original)(CvPlayerPolicies*, int, PolicyBranchTypes), CvPlayerPolicies* self, int iID, PolicyBranchTypes eBranchType);CivRegisterBefore<CivHooks::CvPlayerPolicies_SetPolicyBranchChosen>(host, &BeforeCvPlayerPolicies_SetPolicyBranchChosen);CivRegisterAfter<CivHooks::CvPlayerPolicies_SetPolicyBranchChosen>(host, &AfterCvPlayerPolicies_SetPolicyBranchChosen);CivRegisterReplace<CivHooks::CvPlayerPolicies_SetPolicyBranchChosen>(host, &ReplaceCvPlayerPolicies_SetPolicyBranchChosen);

Code

4276/// Assign Policy Branch adopted4277void CvPlayerPolicies::SetPolicyBranchChosen(int iID, PolicyBranchTypes eBranchType)4278{4279	FAssert(eBranchType > -1);4280	FAssert(eBranchType < m_pPolicies->GetNumPolicyBranches());42814282	if(iID < GetNumPolicyBranchesAllowed())4283	{4284		m_paePolicyBranchesChosen[iID] = eBranchType;4285	}4286	else4287	{4288		FAssert(false);4289	}4290}

Calls