Bazaar developer reference

CvPlayerTechs::GetNumTechsCanBeResearched() const

Defined in
CvTechClasses.cpp, line 1496
Class
CvPlayerTechs
Hook name
CivHooks::CvPlayerTechs_GetNumTechsCanBeResearched

Hooks

static bool BeforeCvPlayerTechs_GetNumTechsCanBeResearched(const CvPlayerTechs* self, int& result);static void AfterCvPlayerTechs_GetNumTechsCanBeResearched(const CvPlayerTechs* self, int& result);static int ReplaceCvPlayerTechs_GetNumTechsCanBeResearched(int (*original)(const CvPlayerTechs*), const CvPlayerTechs* self);CivRegisterBefore<CivHooks::CvPlayerTechs_GetNumTechsCanBeResearched>(host, &BeforeCvPlayerTechs_GetNumTechsCanBeResearched);CivRegisterAfter<CivHooks::CvPlayerTechs_GetNumTechsCanBeResearched>(host, &AfterCvPlayerTechs_GetNumTechsCanBeResearched);CivRegisterReplace<CivHooks::CvPlayerTechs_GetNumTechsCanBeResearched>(host, &ReplaceCvPlayerTechs_GetNumTechsCanBeResearched);

Code

1495/// How many techs can we research at present?1496int CvPlayerTechs::GetNumTechsCanBeResearched() const1497{1498	int rtnValue = 0;14991500	for(int iTechLoop = 0; iTechLoop < GetTechs()->GetNumTechs(); iTechLoop++)1501	{1502		if(CanResearch((TechTypes)iTechLoop))1503		{1504			rtnValue++;1505		}1506	}15071508	return rtnValue;1509}

Calls

Called by