CvMinorCivAI::GetNumActivePersonalQuestsForPlayer(PlayerTypes) const
- Defined in
- CvMinorCivAI.cpp, line 5057
- Class
- CvMinorCivAI
- Hook name
CivHooks::CvMinorCivAI_GetNumActivePersonalQuestsForPlayer
Hooks
static bool BeforeCvMinorCivAI_GetNumActivePersonalQuestsForPlayer(const CvMinorCivAI* self, PlayerTypes ePlayer, int& result);static void AfterCvMinorCivAI_GetNumActivePersonalQuestsForPlayer(const CvMinorCivAI* self, PlayerTypes ePlayer, int& result);static int ReplaceCvMinorCivAI_GetNumActivePersonalQuestsForPlayer(int (*original)(const CvMinorCivAI*, PlayerTypes), const CvMinorCivAI* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvMinorCivAI_GetNumActivePersonalQuestsForPlayer>(host, &BeforeCvMinorCivAI_GetNumActivePersonalQuestsForPlayer);CivRegisterAfter<CivHooks::CvMinorCivAI_GetNumActivePersonalQuestsForPlayer>(host, &AfterCvMinorCivAI_GetNumActivePersonalQuestsForPlayer);CivRegisterReplace<CivHooks::CvMinorCivAI_GetNumActivePersonalQuestsForPlayer>(host, &ReplaceCvMinorCivAI_GetNumActivePersonalQuestsForPlayer);
Code
5057int CvMinorCivAI::GetNumActivePersonalQuestsForPlayer(PlayerTypes ePlayer) const5058{5059 CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)");5060 CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)");5061 if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return 0;50625063 int iCount = 0;5064 for(uint iQuestLoop = 0; iQuestLoop < m_QuestsGiven[ePlayer].size(); iQuestLoop++)5065 {5066 if(IsPersonalQuest(m_QuestsGiven[ePlayer][iQuestLoop].GetType()))5067 {5068 iCount++;5069 }5070 }50715072 return iCount;5073}
Calls
BaseVector::operator[]BaseVector::operator[]BaseVector::size- CvMinorCivAI::IsPersonalQuest(MinorCivQuestTypes) const
- CvMinorCivQuest::GetType() const