Bazaar developer reference

CvPlayer::GetMilitaryMight() const

Defined in
CvPlayer.cpp, line 16980
Class
CvPlayer
Hook name
CivHooks::CvPlayer_GetMilitaryMight

Hooks

static bool BeforeCvPlayer_GetMilitaryMight(const CvPlayer* self, int& result);static void AfterCvPlayer_GetMilitaryMight(const CvPlayer* self, int& result);static int ReplaceCvPlayer_GetMilitaryMight(int (*original)(const CvPlayer*), const CvPlayer* self);CivRegisterBefore<CivHooks::CvPlayer_GetMilitaryMight>(host, &BeforeCvPlayer_GetMilitaryMight);CivRegisterAfter<CivHooks::CvPlayer_GetMilitaryMight>(host, &AfterCvPlayer_GetMilitaryMight);CivRegisterReplace<CivHooks::CvPlayer_GetMilitaryMight>(host, &ReplaceCvPlayer_GetMilitaryMight);

Code

16980int CvPlayer::GetMilitaryMight() const16981{16982	if(m_iTurnMightRecomputed < GC.getGame().getElapsedGameTurns())16983	{16984		// more lazy evaluation16985		const_cast<CvPlayer*>(this)->m_iTurnMightRecomputed = GC.getGame().getElapsedGameTurns();16986		const_cast<CvPlayer*>(this)->m_iMilitaryMight = calculateMilitaryMight();16987		const_cast<CvPlayer*>(this)->m_iEconomicMight = calculateEconomicMight();16988	}16989	return m_iMilitaryMight;16990}

Calls

Called by