void Notify::_exec(Game& game, unsigned int) { world::CityPtr pCity = game.empire()->findCity( _d->cityname ); if( is_kind_of<PlayerCity>( pCity ) ) { PlayerCityPtr plrCity = ptr_cast<PlayerCity>( pCity ); MilitaryPtr mil = statistic::getService<Military>( plrCity ); if( mil.isValid() ) { mil->addNotification( _d->message, _d->object, (Notification::Type)_d->type ); } } }
void Notify::_exec(Game& game, unsigned int) { world::CityPtr pCity = game.empire()->findCity( _d->cityname ); PlayerCityPtr plrCity = ptr_cast<PlayerCity>( pCity ); if( plrCity.isValid() ) { MilitaryPtr mil = plrCity->statistic().services.find<Military>(); if( mil.isValid() ) { mil->addNotification( _d->message, _d->object, (Notification::Type)_d->type ); } } }