Bazaar developer reference

CvPlayer::changeBuildingClassCount(BuildingClassTypes, int)

Defined in
CvPlayer.cpp, line 20579
Class
CvPlayer
Hook name
CivHooks::CvPlayer_changeBuildingClassCount

Hooks

static bool BeforeCvPlayer_changeBuildingClassCount(CvPlayer* self, BuildingClassTypes eIndex, int iChange);static void AfterCvPlayer_changeBuildingClassCount(CvPlayer* self, BuildingClassTypes eIndex, int iChange);static void ReplaceCvPlayer_changeBuildingClassCount(void (*original)(CvPlayer*, BuildingClassTypes, int), CvPlayer* self, BuildingClassTypes eIndex, int iChange);CivRegisterBefore<CivHooks::CvPlayer_changeBuildingClassCount>(host, &BeforeCvPlayer_changeBuildingClassCount);CivRegisterAfter<CivHooks::CvPlayer_changeBuildingClassCount>(host, &AfterCvPlayer_changeBuildingClassCount);CivRegisterReplace<CivHooks::CvPlayer_changeBuildingClassCount>(host, &ReplaceCvPlayer_changeBuildingClassCount);

Code

20579void CvPlayer::changeBuildingClassCount(BuildingClassTypes eIndex, int iChange)20580{20581	CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)");20582	CvAssertMsg(eIndex < GC.getNumBuildingClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)");20583	m_paiBuildingClassCount.setAt(eIndex, m_paiBuildingClassCount[eIndex] + iChange);20584	CvAssert(getBuildingClassCount(eIndex) >= 0);20585}

Calls

Called by