CvPlayerTechs::GetResearchProgress(TechTypes) const
- Defined in
- CvTechClasses.cpp, line 1555
- Class
- CvPlayerTechs
- Hook name
CivHooks::CvPlayerTechs_GetResearchProgress
Hooks
static bool BeforeCvPlayerTechs_GetResearchProgress(const CvPlayerTechs* self, TechTypes eTech, int& result);static void AfterCvPlayerTechs_GetResearchProgress(const CvPlayerTechs* self, TechTypes eTech, int& result);static int ReplaceCvPlayerTechs_GetResearchProgress(int (*original)(const CvPlayerTechs*, TechTypes), const CvPlayerTechs* self, TechTypes eTech);CivRegisterBefore<CivHooks::CvPlayerTechs_GetResearchProgress>(host, &BeforeCvPlayerTechs_GetResearchProgress);CivRegisterAfter<CivHooks::CvPlayerTechs_GetResearchProgress>(host, &AfterCvPlayerTechs_GetResearchProgress);CivRegisterReplace<CivHooks::CvPlayerTechs_GetResearchProgress>(host, &ReplaceCvPlayerTechs_GetResearchProgress);
Code
1554/// Return the research progress for a tech for this player.1555int CvPlayerTechs::GetResearchProgress(TechTypes eTech) const1556{1557 // Get the research progress for the team1558 int iResearchProgress = GET_TEAM(m_pPlayer->getTeam()).GetTeamTechs()->GetResearchProgress(eTech);1559 // Add in any overflow we have yet to accumulate into the research progress.1560 // Overflow is the leftover research from the previous research. It is automatically rolled into the main progress value1561 // the next time research is 'updated'.1562 iResearchProgress += m_pPlayer->getOverflowResearch();15631564 return iResearchProgress;1565}