| 271 | } |
| 272 | |
| 273 | void EveSpaceObject2::OnListModified( long event, ssize_t key, ssize_t key2, IRoot* value, const IList* list ) |
| 274 | { |
| 275 | if( list == &m_controllers && ( event & BELIST_LOADING ) == 0 ) |
| 276 | { |
| 277 | switch( event & BELIST_EVENTMASK ) |
| 278 | { |
| 279 | case BELIST_INSERTED: |
| 280 | if( ITr2ControllerPtr controller = BlueCastPtr( value ) ) |
| 281 | { |
| 282 | controller->Link( *GetRawRoot() ); |
| 283 | for( auto it = begin( m_controllerVariables ); it != end( m_controllerVariables ); ++it ) |
| 284 | { |
| 285 | controller->SetVariable( it->first.c_str(), it->second ); |
| 286 | } |
| 287 | } |
| 288 | break; |
| 289 | case BELIST_REMOVED: |
| 290 | if( ITr2ControllerPtr controller = BlueCastPtr( value ) ) |
| 291 | { |
| 292 | controller->Unlink(); |
| 293 | } |
| 294 | break; |
| 295 | case BELIST_UNLOADSTART: |
| 296 | for( auto& controller : m_controllers ) |
| 297 | { |
| 298 | controller->Unlink(); |
| 299 | } |
| 300 | break; |
| 301 | default: |
| 302 | break; |
| 303 | } |
| 304 | } |
| 305 | else if( list == &m_effectChildren && ( event & BELIST_LOADING ) == 0 ) |
| 306 | { |
| 307 | switch( event & BELIST_EVENTMASK ) |
| 308 | { |
| 309 | case BELIST_INSERTED: |
| 310 | if( IEveSpaceObjectChildPtr child = BlueCastPtr( value ) ) |
| 311 | { |
| 312 | for( auto it = begin( m_controllerVariables ); it != end( m_controllerVariables ); ++it ) |
| 313 | { |
| 314 | child->SetControllerVariable( it->first.c_str(), it->second ); |
| 315 | } |
| 316 | } |
| 317 | if( IsInRegistry() ) |
| 318 | { |
| 319 | if( EveEntityPtr entity = BlueCastPtr( value ) ) |
| 320 | { |
| 321 | entity->Register( this->GetComponentRegistry() ); |
| 322 | } |
| 323 | } |
| 324 | break; |
| 325 | case BELIST_REMOVED: |
| 326 | if( EveEntityPtr entity = BlueCastPtr( value ) ) |
| 327 | { |
| 328 | entity->UnRegister( this->GetComponentRegistry() ); |
| 329 | } |
| 330 | break; |
nothing calls this directly
no test coverage detected