Bazaar developer reference

CvDllPlayer::GetCurrentResearchTech(TechTypes *, int *) const

Defined in
CvDllPlayer.cpp, line 445
Class
CvDllPlayer
Hook name
CivHooks::CvDllPlayer_GetCurrentResearchTech

Hooks

static bool BeforeCvDllPlayer_GetCurrentResearchTech(const CvDllPlayer* self, TechTypes* pkTech, int * pkTurnsLeft, bool& result);static void AfterCvDllPlayer_GetCurrentResearchTech(const CvDllPlayer* self, TechTypes* pkTech, int * pkTurnsLeft, bool& result);static bool ReplaceCvDllPlayer_GetCurrentResearchTech(bool (*original)(const CvDllPlayer*, TechTypes*, int *), const CvDllPlayer* self, TechTypes* pkTech, int * pkTurnsLeft);// CivHooks.h gives this hook point no types, so nothing checks these hooks' parameters.host->RegisterHook(host->pluginIndex, CivHooks::CvDllPlayer_GetCurrentResearchTech::ID, CIV_HOOK_BEFORE, (void*)&BeforeCvDllPlayer_GetCurrentResearchTech);host->RegisterHook(host->pluginIndex, CivHooks::CvDllPlayer_GetCurrentResearchTech::ID, CIV_HOOK_AFTER, (void*)&AfterCvDllPlayer_GetCurrentResearchTech);host->RegisterHook(host->pluginIndex, CivHooks::CvDllPlayer_GetCurrentResearchTech::ID, CIV_HOOK_REPLACE, (void*)&ReplaceCvDllPlayer_GetCurrentResearchTech);

Code

445bool CvDllPlayer::GetCurrentResearchTech(TechTypes* pkTech, int *pkTurnsLeft) const446{447	CvPlayerTechs* pkTechs = m_pPlayer->GetPlayerTechs();448	if (pkTechs)449	{450		if (pkTech)451			*pkTech = pkTechs->GetCurrentResearch();452		if (pkTurnsLeft)453			*pkTurnsLeft = pkTechs->GetResearchTurnsLeft(pkTechs->GetCurrentResearch(), false);454		return true;455	}456	return false;457}

Calls