CvPlayer::setOption(PlayerOptionTypes, bool)
- Defined in
- CvPlayer.cpp, line 19793
- Class
- CvPlayer
- Hook name
CivHooks::CvPlayer_setOption
Hooks
static bool BeforeCvPlayer_setOption(CvPlayer* self, PlayerOptionTypes eID, bool bNewValue);static void AfterCvPlayer_setOption(CvPlayer* self, PlayerOptionTypes eID, bool bNewValue);static void ReplaceCvPlayer_setOption(void (*original)(CvPlayer*, PlayerOptionTypes, bool), CvPlayer* self, PlayerOptionTypes eID, bool bNewValue);CivRegisterBefore<CivHooks::CvPlayer_setOption>(host, &BeforeCvPlayer_setOption);CivRegisterAfter<CivHooks::CvPlayer_setOption>(host, &AfterCvPlayer_setOption);CivRegisterReplace<CivHooks::CvPlayer_setOption>(host, &ReplaceCvPlayer_setOption);
Code
19793void CvPlayer::setOption(PlayerOptionTypes eID, bool bNewValue)19794{19795 int iIndex = 0;19796 for (PlayerOptionsVector::const_iterator itr = m_aOptions.begin(); itr != m_aOptions.end(); ++itr )19797 {19798 if ((*itr).first == eID)19799 {19800 m_aOptions.setAt(iIndex, PlayerOptionEntry((uint)eID, bNewValue?1:0));19801 return;19802 }19803 ++iIndex;19804 }1980519806 m_aOptions.push_back(PlayerOptionEntry((uint)eID, bNewValue?1:0));19807}
Calls
FAutoVariable::beginFAutoVariable::endFAutoVariable::push_backFAutoVariable::setAtstd::_Vector_const_iterator::operator!=std::_Vector_const_iterator::operator*std::_Vector_const_iterator::operator++std::pair::pair