| 77 | } |
| 78 | |
| 79 | void EveEffectRoot2::OnListModified( long event, ssize_t key, ssize_t key2, IRoot* value, const IList* list ) |
| 80 | { |
| 81 | if( list == &m_controllers && ( event & BELIST_LOADING ) == 0 ) |
| 82 | { |
| 83 | switch( event & BELIST_EVENTMASK ) |
| 84 | { |
| 85 | case BELIST_INSERTED: |
| 86 | if( ITr2ControllerPtr controller = BlueCastPtr( value ) ) |
| 87 | { |
| 88 | controller->Link( *GetRawRoot() ); |
| 89 | for( auto it = begin( m_controllerVariables ); it != end( m_controllerVariables ); ++it ) |
| 90 | { |
| 91 | controller->SetVariable( it->first.c_str(), it->second ); |
| 92 | } |
| 93 | } |
| 94 | break; |
| 95 | case BELIST_REMOVED: |
| 96 | if( ITr2ControllerPtr controller = BlueCastPtr( value ) ) |
| 97 | { |
| 98 | controller->Unlink(); |
| 99 | } |
| 100 | break; |
| 101 | case BELIST_UNLOADSTART: |
| 102 | for( auto& controller : m_controllers ) |
| 103 | { |
| 104 | controller->Unlink(); |
| 105 | } |
| 106 | break; |
| 107 | default: |
| 108 | break; |
| 109 | } |
| 110 | } |
| 111 | else if( list == &m_effectChildren && ( event & BELIST_LOADING ) == 0 ) |
| 112 | { |
| 113 | switch( event & BELIST_EVENTMASK ) |
| 114 | { |
| 115 | case BELIST_INSERTED: |
| 116 | if( IEveSpaceObjectChildPtr child = BlueCastPtr( value ) ) |
| 117 | { |
| 118 | for( auto it = begin( m_controllerVariables ); it != end( m_controllerVariables ); ++it ) |
| 119 | { |
| 120 | child->SetControllerVariable( it->first.c_str(), it->second ); |
| 121 | } |
| 122 | child->StartControllers(); |
| 123 | } |
| 124 | if( IsInRegistry() ) |
| 125 | { |
| 126 | if( EveEntityPtr entity = BlueCastPtr( value ) ) |
| 127 | { |
| 128 | entity->Register( GetComponentRegistry() ); |
| 129 | } |
| 130 | } |
| 131 | break; |
| 132 | case BELIST_REMOVED: |
| 133 | if( IsInRegistry() ) |
| 134 | { |
| 135 | if( EveEntityPtr entity = BlueCastPtr( value ) ) |
| 136 | { |
nothing calls this directly
no test coverage detected