CvPlayerPolicies::IsPolicyBlocked(PolicyTypes) const
- Defined in
- CvPolicyClasses.cpp, line 4043
- Class
- CvPlayerPolicies
- Hook name
CivHooks::CvPlayerPolicies_IsPolicyBlocked
Hooks
static bool BeforeCvPlayerPolicies_IsPolicyBlocked(const CvPlayerPolicies* self, PolicyTypes eType, bool& result);static void AfterCvPlayerPolicies_IsPolicyBlocked(const CvPlayerPolicies* self, PolicyTypes eType, bool& result);static bool ReplaceCvPlayerPolicies_IsPolicyBlocked(bool (*original)(const CvPlayerPolicies*, PolicyTypes), const CvPlayerPolicies* self, PolicyTypes eType);CivRegisterBefore<CivHooks::CvPlayerPolicies_IsPolicyBlocked>(host, &BeforeCvPlayerPolicies_IsPolicyBlocked);CivRegisterAfter<CivHooks::CvPlayerPolicies_IsPolicyBlocked>(host, &AfterCvPlayerPolicies_IsPolicyBlocked);CivRegisterReplace<CivHooks::CvPlayerPolicies_IsPolicyBlocked>(host, &ReplaceCvPlayerPolicies_IsPolicyBlocked);
Code
4042/// Accessor: is eType blocked because of choices?4043bool CvPlayerPolicies::IsPolicyBlocked(PolicyTypes eType) const4044{4045 CvAssertMsg(eType >= 0, "eIndex is expected to be non-negative (invalid Index)");4046 CvAssertMsg(eType < m_pPolicies->GetNumPolicies(), "eIndex is expected to be within maximum bounds (invalid Index)");40474048 // Get the policy branch we have to check.4049 PolicyBranchTypes eBranch = m_paePolicyBlockedBranchCheck[eType];4050 if (eBranch == NO_POLICY_BRANCH_TYPE)4051 return false; // Policy has no branch40524053 return IsPolicyBranchBlocked(eBranch);4054}
Calls
Called by
- CvCity::GetLocalHappiness() const
- CvCity::init(int, PlayerTypes, int, int, bool, bool, ReligionTypes, const char *)
- CvCity::processBuilding(BuildingTypes, int, bool, bool, bool)
- CvMinorCivAI::SetAlly(PlayerTypes)
- CvPlayerPolicies::GetBuildingClassProductionModifier(BuildingClassTypes)
- CvPlayerPolicies::GetBuildingClassTourismModifier(BuildingClassTypes)
- CvPlayerPolicies::GetBuildingClassYieldChange(BuildingClassTypes, YieldTypes)
- CvPlayerPolicies::GetBuildingClassYieldModifier(BuildingClassTypes, YieldTypes)
- CvPlayerPolicies::GetFreeBuildingsOnConquest()
- CvPlayerPolicies::GetImprovementCultureChange(ImprovementTypes)
- CvPlayerPolicies::GetNumericModifier(PolicyModifierType)
- CvPlayerPolicies::GetTourismFromUnitCreation(UnitClassTypes) const
- CvPlayerPolicies::GetWeLoveTheKingString()
- CvPlayerPolicies::GetYieldModifier(YieldTypes)
- CvPlayerPolicies::HasPolicyEncouragingGarrisons() const
- CvPlayerPolicies::HasPolicyGrantingReformationBelief() const
- CvLuaPlayer::lGetExtraBuildingHappinessFromPolicies(lua_State *)
- CvLuaPlayer::lIsPolicyBlocked(lua_State *)