CvLeague::IsEnactProposed(ResolutionTypes, int)
- Defined in
- CvVotingClasses.cpp, line 2849
- Class
- CvLeague
- Hook name
CivHooks::CvLeague_IsEnactProposed
Hooks
static bool BeforeCvLeague_IsEnactProposed(CvLeague* self, ResolutionTypes eResolution, int iProposerChoice, bool& result);static void AfterCvLeague_IsEnactProposed(CvLeague* self, ResolutionTypes eResolution, int iProposerChoice, bool& result);static bool ReplaceCvLeague_IsEnactProposed(bool (*original)(CvLeague*, ResolutionTypes, int), CvLeague* self, ResolutionTypes eResolution, int iProposerChoice);CivRegisterBefore<CivHooks::CvLeague_IsEnactProposed>(host, &BeforeCvLeague_IsEnactProposed);CivRegisterAfter<CivHooks::CvLeague_IsEnactProposed>(host, &AfterCvLeague_IsEnactProposed);CivRegisterReplace<CivHooks::CvLeague_IsEnactProposed>(host, &ReplaceCvLeague_IsEnactProposed);
Code
2848//antonjs: todo: refactor:2849bool CvLeague::IsEnactProposed(ResolutionTypes eResolution, int iProposerChoice)2850{2851 CvAssertMsg(eResolution >= 0, "Invalid resolution type. Please send Anton your save file and version.");2852 CvAssertMsg(eResolution < GC.getNumResolutionInfos(), "Resolution index out of bounds. Please send Anton your save file and version.");28532854 for (uint i = 0; i < m_vEnactProposals.size(); i++)2855 {2856 if (m_vEnactProposals[i].GetType() == eResolution)2857 {2858 CvResolutionEntry* pInfo = GC.getResolutionInfo(eResolution);2859 if (pInfo != NULL)2860 {2861 // Unique Type resolutions can only have one active resolution of its type at once2862 if (pInfo->IsUniqueType())2863 {2864 return true;2865 }28662867 if (m_vEnactProposals[i].GetProposerDecision()->GetDecision() == iProposerChoice)2868 {2869 return true;2870 }2871 }2872 }2873 }28742875 return false;2876}