Bazaar developer reference

CvPlayer::GetFreePromotionCount(PromotionTypes) const

Defined in
CvPlayer.cpp, line 20345
Class
CvPlayer
Hook name
CivHooks::CvPlayer_GetFreePromotionCount

Hooks

static bool BeforeCvPlayer_GetFreePromotionCount(const CvPlayer* self, PromotionTypes ePromotion, int& result);static void AfterCvPlayer_GetFreePromotionCount(const CvPlayer* self, PromotionTypes ePromotion, int& result);static int ReplaceCvPlayer_GetFreePromotionCount(int (*original)(const CvPlayer*, PromotionTypes), const CvPlayer* self, PromotionTypes ePromotion);CivRegisterBefore<CivHooks::CvPlayer_GetFreePromotionCount>(host, &BeforeCvPlayer_GetFreePromotionCount);CivRegisterAfter<CivHooks::CvPlayer_GetFreePromotionCount>(host, &AfterCvPlayer_GetFreePromotionCount);CivRegisterReplace<CivHooks::CvPlayer_GetFreePromotionCount>(host, &ReplaceCvPlayer_GetFreePromotionCount);

Code

20344/// Is ePromotion a free promotion?20345int CvPlayer::GetFreePromotionCount(PromotionTypes ePromotion) const20346{20347	CvAssertMsg(ePromotion >= 0, "ePromotion is expected to be non-negative (invalid Index)");20348	CvAssertMsg(ePromotion < GC.getNumPromotionInfos(), "ePromotion is expected to be within maximum bounds (invalid Index)");20349	return m_paiFreePromotionCount[ePromotion];20350}

Calls

Called by