CvPlayerPolicies::GetWeLoveTheKingString()
- Defined in
- CvPolicyClasses.cpp, line 3338
- Class
- CvPlayerPolicies
- Hook name
CivHooks::CvPlayerPolicies_GetWeLoveTheKingString
Hooks
static bool BeforeCvPlayerPolicies_GetWeLoveTheKingString(CvPlayerPolicies* self, CvString& result);static void AfterCvPlayerPolicies_GetWeLoveTheKingString(CvPlayerPolicies* self, CvString& result);static CvString ReplaceCvPlayerPolicies_GetWeLoveTheKingString(CvString (*original)(CvPlayerPolicies*), CvPlayerPolicies* self);CivRegisterBefore<CivHooks::CvPlayerPolicies_GetWeLoveTheKingString>(host, &BeforeCvPlayerPolicies_GetWeLoveTheKingString);CivRegisterAfter<CivHooks::CvPlayerPolicies_GetWeLoveTheKingString>(host, &AfterCvPlayerPolicies_GetWeLoveTheKingString);CivRegisterReplace<CivHooks::CvPlayerPolicies_GetWeLoveTheKingString>(host, &ReplaceCvPlayerPolicies_GetWeLoveTheKingString);
Code
3337/// Returns the proper ruler name for "We love the XXX day"3338CvString CvPlayerPolicies::GetWeLoveTheKingString()3339{3340 CvString rtnValue;33413342 // Policies are arranged from least to most advanced in XML3343 // So loop from back to front until we find a string3344 for(int i = m_pPolicies->GetNumPolicies() - 1; i >= 0; i--)3345 {3346 // Do we have this policy?3347 if(m_pabHasPolicy[i] && !IsPolicyBlocked((PolicyTypes)i))3348 {3349 // Does it have a string for us?3350 CvString str = m_pPolicies->GetPolicyEntry(i)->GetWeLoveTheKing();3351 if(str.length() > 0)3352 {3353 rtnValue = str;3354 break; // All done when find the first one3355 }3356 }3357 }33583359 return rtnValue;3360}
Calls
- CvPlayerPolicies::IsPolicyBlocked(PolicyTypes) const
- CvPolicyEntry::GetWeLoveTheKing()
- CvPolicyXMLEntries::GetNumPolicies()
- CvPolicyXMLEntries::GetPolicyEntry(int)
CvString::CvStringCvString::CvStringCvString::CvStringCvString::operator=std::basic_string::length