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

Method OnListModified

trinity/Eve/EveEffectRoot2.cpp:79–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77}
78
79void 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 {

Callers

nothing calls this directly

Calls 13

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

Tested by

no test coverage detected