CvPlayer::getPower() const
- Defined in
- CvPlayer.cpp, line 16967
- Class
- CvPlayer
- Hook name
CivHooks::CvPlayer_getPower
Hooks
static bool BeforeCvPlayer_getPower(const CvPlayer* self, int& result);static void AfterCvPlayer_getPower(const CvPlayer* self, int& result);static int ReplaceCvPlayer_getPower(int (*original)(const CvPlayer*), const CvPlayer* self);CivRegisterBefore<CivHooks::CvPlayer_getPower>(host, &BeforeCvPlayer_getPower);CivRegisterAfter<CivHooks::CvPlayer_getPower>(host, &AfterCvPlayer_getPower);CivRegisterReplace<CivHooks::CvPlayer_getPower>(host, &ReplaceCvPlayer_getPower);
Code
16967int CvPlayer::getPower() const16968{16969 if(m_iTurnMightRecomputed < GC.getGame().getElapsedGameTurns())16970 {16971 // more lazy evaluation16972 const_cast<CvPlayer*>(this)->m_iTurnMightRecomputed = GC.getGame().getElapsedGameTurns();16973 const_cast<CvPlayer*>(this)->m_iMilitaryMight = calculateMilitaryMight();16974 const_cast<CvPlayer*>(this)->m_iEconomicMight = calculateEconomicMight();16975 }16976 return m_iMilitaryMight + m_iEconomicMight;16977}
Calls
- CvGame::getElapsedGameTurns() const
- CvGlobals::getGame()
- CvPlayer::calculateEconomicMight() const
- CvPlayer::calculateMilitaryMight() const
FAutoVariable::operator const int &FAutoVariable::operator=