Bazaar developer reference

CvPlayer::isUnitClassMaxedOut(UnitClassTypes, int) const

Defined in
CvPlayer.cpp, line 20452
Class
CvPlayer
Hook name
CivHooks::CvPlayer_isUnitClassMaxedOut

Hooks

static bool BeforeCvPlayer_isUnitClassMaxedOut(const CvPlayer* self, UnitClassTypes eIndex, int iExtra, bool& result);static void AfterCvPlayer_isUnitClassMaxedOut(const CvPlayer* self, UnitClassTypes eIndex, int iExtra, bool& result);static bool ReplaceCvPlayer_isUnitClassMaxedOut(bool (*original)(const CvPlayer*, UnitClassTypes, int), const CvPlayer* self, UnitClassTypes eIndex, int iExtra);CivRegisterBefore<CivHooks::CvPlayer_isUnitClassMaxedOut>(host, &BeforeCvPlayer_isUnitClassMaxedOut);CivRegisterAfter<CivHooks::CvPlayer_isUnitClassMaxedOut>(host, &AfterCvPlayer_isUnitClassMaxedOut);CivRegisterReplace<CivHooks::CvPlayer_isUnitClassMaxedOut>(host, &ReplaceCvPlayer_isUnitClassMaxedOut);

Code

20452bool CvPlayer::isUnitClassMaxedOut(UnitClassTypes eIndex, int iExtra) const20453{20454	CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)");20455	CvAssertMsg(eIndex < GC.getNumUnitClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)");2045620457	CvUnitClassInfo* pkUnitClassInfo = GC.getUnitClassInfo(eIndex);20458	if(pkUnitClassInfo == NULL)20459	{20460		return false;20461	}2046220463	if(!isNationalUnitClass(eIndex))20464	{20465		return false;20466	}2046720468	CvAssertMsg(getUnitClassCount(eIndex) <= pkUnitClassInfo->getMaxPlayerInstances(), "getUnitClassCount is expected to be less than maximum bound of MaxPlayerInstances (invalid index)");2046920470	return ((getUnitClassCount(eIndex) + iExtra) >= pkUnitClassInfo->getMaxPlayerInstances());20471}

Calls

Called by