Bazaar developer reference

CvPlayerTechs::CanResearchForFree(TechTypes) const

Defined in
CvTechClasses.cpp, line 1276
Class
CvPlayerTechs
Hook name
CivHooks::CvPlayerTechs_CanResearchForFree

Hooks

static bool BeforeCvPlayerTechs_CanResearchForFree(const CvPlayerTechs* self, TechTypes eTech, bool& result);static void AfterCvPlayerTechs_CanResearchForFree(const CvPlayerTechs* self, TechTypes eTech, bool& result);static bool ReplaceCvPlayerTechs_CanResearchForFree(bool (*original)(const CvPlayerTechs*, TechTypes), const CvPlayerTechs* self, TechTypes eTech);CivRegisterBefore<CivHooks::CvPlayerTechs_CanResearchForFree>(host, &BeforeCvPlayerTechs_CanResearchForFree);CivRegisterAfter<CivHooks::CvPlayerTechs_CanResearchForFree>(host, &AfterCvPlayerTechs_CanResearchForFree);CivRegisterReplace<CivHooks::CvPlayerTechs_CanResearchForFree>(host, &ReplaceCvPlayerTechs_CanResearchForFree);

Code

1275/// Can we pick this as a Free Tech (ex. from a Wonder)?1276bool CvPlayerTechs::CanResearchForFree(TechTypes eTech) const1277{1278	CvAssertMsg(eTech >= 0, "eTech is expected to be non-negative (invalid Index)");1279	CvAssertMsg(eTech < GC.getNumTechInfos(), "eTech is expected to be within maximum bounds (invalid Index)");1280	if(eTech < 0 || eTech >= GC.getNumTechInfos()) return false;12811282	// We can pick any tech that we are able to research1283	return CanResearch(eTech);1284}

Calls

Called by