CvCity::setName(const char *, bool)
- Defined in
- CvCity.cpp, line 11296
- Class
- CvCity
- Hook name
CivHooks::CvCity_setName
Hooks
static bool BeforeCvCity_setName(CvCity* self, const char* szNewValue, bool bFound);static void AfterCvCity_setName(CvCity* self, const char* szNewValue, bool bFound);static void ReplaceCvCity_setName(void (*original)(CvCity*, const char*, bool), CvCity* self, const char* szNewValue, bool bFound);CivRegisterBefore<CivHooks::CvCity_setName>(host, &BeforeCvCity_setName);CivRegisterAfter<CivHooks::CvCity_setName>(host, &AfterCvCity_setName);CivRegisterReplace<CivHooks::CvCity_setName>(host, &ReplaceCvCity_setName);
Code
11296void CvCity::setName(const char* szNewValue, bool bFound)11297{11298 VALIDATE_OBJECT11299 CvString strName(szNewValue);11300 gDLL->stripSpecialCharacters(strName);1130111302 if(!strName.IsEmpty())11303 {11304 if(GET_PLAYER(getOwner()).isCityNameValid(strName, false))11305 {11306 m_strName = strName;1130711308 if(isCitySelected())11309 {11310 DLLUI->setDirty(CityScreen_DIRTY_BIT, true);11311 }113121131311314 auto_ptr<ICvCity1> pCity = GC.WrapCityPointer(this);11315 DLLUI->SetSpecificCityInfoDirty(pCity.get(), CITY_UPDATE_TYPE_BANNER);11316 }11317 if(bFound)11318 {11319 doFoundMessage();11320 }11321 }11322}
Calls
- CvCity::doFoundMessage()
- CvCity::getOwner() const
- CvCity::isCitySelected()
- CvGlobals::getDLLIFace()
- CvGlobals::GetEngineUserInterface()
- CvGlobals::WrapCityPointer(CvCity *)
- CvPlayer::isCityNameValid(CvString &, bool) const
- CvPlayerAI::getPlayer(PlayerTypes)
CvString::CvStringCvString::IsEmptyCvString::operator=ICvEngineUtility1::stripSpecialCharactersICvUserInterface1::setDirtyICvUserInterface1::SetSpecificCityInfoDirtystd::auto_ptr::auto_ptrstd::auto_ptr::getstd::auto_ptr::operator auto_ptr_ref