| 109 | } |
| 110 | |
| 111 | void EveChildContainer::OnListModified( long event, ssize_t key, ssize_t key2, IRoot* value, const IList* list ) |
| 112 | { |
| 113 | if( list == &m_controllers && ( event & BELIST_LOADING ) == 0 ) |
| 114 | { |
| 115 | switch( event & BELIST_EVENTMASK ) |
| 116 | { |
| 117 | case BELIST_INSERTED: |
| 118 | if( ITr2ControllerPtr controller = BlueCastPtr( value ) ) |
| 119 | { |
| 120 | controller->Link( *GetRawRoot() ); |
| 121 | for( auto it = begin( m_controllerVariables ); it != end( m_controllerVariables ); ++it ) |
| 122 | { |
| 123 | controller->SetVariable( it->first.c_str(), it->second ); |
| 124 | } |
| 125 | } |
| 126 | break; |
| 127 | case BELIST_REMOVED: |
| 128 | if( ITr2ControllerPtr controller = BlueCastPtr( value ) ) |
| 129 | { |
| 130 | controller->Unlink(); |
| 131 | } |
| 132 | break; |
| 133 | case BELIST_UNLOADSTART: |
| 134 | for( auto& controller : m_controllers ) |
| 135 | { |
| 136 | controller->Unlink(); |
| 137 | } |
| 138 | break; |
| 139 | default: |
| 140 | break; |
| 141 | } |
| 142 | } |
| 143 | else if( list == &m_objects && ( event & BELIST_LOADING ) == 0 ) |
| 144 | { |
| 145 | if( IsInRegistry() ) |
| 146 | { |
| 147 | switch( event & BELIST_EVENTMASK ) |
| 148 | { |
| 149 | case BELIST_INSERTED: |
| 150 | if( EveEntityPtr entity = BlueCastPtr( value ) ) |
| 151 | { |
| 152 | entity->Register( GetComponentRegistry() ); |
| 153 | } |
| 154 | break; |
| 155 | case BELIST_REMOVED: |
| 156 | if( EveEntityPtr entity = BlueCastPtr( value ) ) |
| 157 | { |
| 158 | entity->UnRegister( GetComponentRegistry() ); |
| 159 | } |
| 160 | break; |
| 161 | case BELIST_UNLOADSTART: |
| 162 | for( ssize_t i = 0; i < list->GetSize(); ++i ) |
| 163 | { |
| 164 | if( EveEntityPtr entity = BlueCastPtr( list->GetAt( i ) ) ) |
| 165 | { |
| 166 | entity->UnRegister( GetComponentRegistry() ); |
| 167 | } |
| 168 | } |
nothing calls this directly
no test coverage detected