Bazaar developer reference

CvPlayerCulture::GetNumGreatWorkSlots(GreatWorkSlotType) const

Defined in
CvCultureClasses.cpp, line 977
Class
CvPlayerCulture
Hook name
CivHooks::CvPlayerCulture_GetNumGreatWorkSlots_with_GreatWorkSlotType_const

Hooks

static bool BeforeCvPlayerCulture_GetNumGreatWorkSlots_with_GreatWorkSlotType_const(const CvPlayerCulture* self, GreatWorkSlotType eSlotType, int& result);static void AfterCvPlayerCulture_GetNumGreatWorkSlots_with_GreatWorkSlotType_const(const CvPlayerCulture* self, GreatWorkSlotType eSlotType, int& result);static int ReplaceCvPlayerCulture_GetNumGreatWorkSlots_with_GreatWorkSlotType_const(int (*original)(const CvPlayerCulture*, GreatWorkSlotType), const CvPlayerCulture* self, GreatWorkSlotType eSlotType);CivRegisterBefore<CivHooks::CvPlayerCulture_GetNumGreatWorkSlots_with_GreatWorkSlotType_const>(host, &BeforeCvPlayerCulture_GetNumGreatWorkSlots_with_GreatWorkSlotType_const);CivRegisterAfter<CivHooks::CvPlayerCulture_GetNumGreatWorkSlots_with_GreatWorkSlotType_const>(host, &AfterCvPlayerCulture_GetNumGreatWorkSlots_with_GreatWorkSlotType_const);CivRegisterReplace<CivHooks::CvPlayerCulture_GetNumGreatWorkSlots_with_GreatWorkSlotType_const>(host, &ReplaceCvPlayerCulture_GetNumGreatWorkSlots_with_GreatWorkSlotType_const);

Code

976/// How many Great Work slots of a particular type?977int CvPlayerCulture::GetNumGreatWorkSlots(GreatWorkSlotType eSlotType) const978{979	CvCity* pLoopCity = NULL;980	int iLoop = 0;981	int iRtnValue = 0;982983	for(pLoopCity = m_pPlayer->firstCity(&iLoop); pLoopCity != NULL; pLoopCity = m_pPlayer->nextCity(&iLoop))984	{985		iRtnValue += pLoopCity->GetCityCulture()->GetNumAvailableGreatWorkSlots(eSlotType);986	}987988	return iRtnValue;989}

Calls

Called by