Bazaar developer reference

CvTraitEntry::IsEnabledByTech(TeamTypes)

Defined in
CvTraitClasses.cpp, line 1121
Class
CvTraitEntry
Hook name
CivHooks::CvTraitEntry_IsEnabledByTech

Hooks

static bool BeforeCvTraitEntry_IsEnabledByTech(CvTraitEntry* self, TeamTypes eTeam, bool& result);static void AfterCvTraitEntry_IsEnabledByTech(CvTraitEntry* self, TeamTypes eTeam, bool& result);static bool ReplaceCvTraitEntry_IsEnabledByTech(bool (*original)(CvTraitEntry*, TeamTypes), CvTraitEntry* self, TeamTypes eTeam);CivRegisterBefore<CivHooks::CvTraitEntry_IsEnabledByTech>(host, &BeforeCvTraitEntry_IsEnabledByTech);CivRegisterAfter<CivHooks::CvTraitEntry_IsEnabledByTech>(host, &AfterCvTraitEntry_IsEnabledByTech);CivRegisterReplace<CivHooks::CvTraitEntry_IsEnabledByTech>(host, &ReplaceCvTraitEntry_IsEnabledByTech);

Code

1120/// Is this trait enabled by tech?1121bool CvTraitEntry::IsEnabledByTech(TeamTypes eTeam)1122{1123	if(m_iPrereqTech != NO_TECH)1124	{1125		if(GET_TEAM(eTeam).GetTeamTechs()->HasTech((TechTypes)m_iPrereqTech))1126		{1127			return true;1128		}1129		else1130		{1131			return false;1132		}1133	}1134	return true;1135}

Calls

Called by