MCPcopy Create free account
hub / github.com/carbonengine/trinity / OnListModified

Method OnListModified

trinity/Eve/SpaceObject/EveSpaceObject2.cpp:273–479  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

271}
272
273void 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;

Callers

nothing calls this directly

Calls 15

GetComponentRegistryMethod · 0.80
GetPropertiesMethod · 0.80
emptyMethod · 0.80
sizeMethod · 0.80
beginFunction · 0.50
endFunction · 0.50
LinkMethod · 0.45
SetVariableMethod · 0.45
UnlinkMethod · 0.45
SetControllerVariableMethod · 0.45
RegisterMethod · 0.45
UnRegisterMethod · 0.45

Tested by

no test coverage detected