Bazaar developer reference

CvMinorCivAI::GetNumActiveGlobalQuests() const

Defined in
CvMinorCivAI.cpp, line 5028
Class
CvMinorCivAI
Hook name
CivHooks::CvMinorCivAI_GetNumActiveGlobalQuests

Hooks

static bool BeforeCvMinorCivAI_GetNumActiveGlobalQuests(const CvMinorCivAI* self, int& result);static void AfterCvMinorCivAI_GetNumActiveGlobalQuests(const CvMinorCivAI* self, int& result);static int ReplaceCvMinorCivAI_GetNumActiveGlobalQuests(int (*original)(const CvMinorCivAI*), const CvMinorCivAI* self);CivRegisterBefore<CivHooks::CvMinorCivAI_GetNumActiveGlobalQuests>(host, &BeforeCvMinorCivAI_GetNumActiveGlobalQuests);CivRegisterAfter<CivHooks::CvMinorCivAI_GetNumActiveGlobalQuests>(host, &AfterCvMinorCivAI_GetNumActiveGlobalQuests);CivRegisterReplace<CivHooks::CvMinorCivAI_GetNumActiveGlobalQuests>(host, &ReplaceCvMinorCivAI_GetNumActiveGlobalQuests);

Code

5027/// ASSUMPTION: There is no more than one active quest of any given MinorCivQuestTypes5028int CvMinorCivAI::GetNumActiveGlobalQuests() const5029{5030	//antonjs: todo: reevaluate this for efficiency and for use of std::set50315032	std::set<MinorCivQuestTypes> setGlobalQuests;50335034	for(uint iPlayerLoop = 0; iPlayerLoop < m_QuestsGiven.size(); iPlayerLoop++)5035	{5036		for(uint iQuestLoop = 0; iQuestLoop < m_QuestsGiven[iPlayerLoop].size(); iQuestLoop++)5037		{5038			if(IsGlobalQuest(m_QuestsGiven[iPlayerLoop][iQuestLoop].GetType()))5039			{5040				setGlobalQuests.insert(m_QuestsGiven[iPlayerLoop][iQuestLoop].GetType());5041			}5042		}5043	}50445045	return setGlobalQuests.size();5046}

Calls

Called by