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

Method Stop

trinity/Controllers/Actions/Tr2ActionChildEffect.cpp:139–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137}
138
139void Tr2ActionChildEffect::Stop( ITr2ActionController& controller )
140{
141 if( m_child && m_removeOnStop )
142 {
143 IEveEffectChildrenOwnerPtr owner = BlueCastPtr( controller.GetOwner() );
144
145 if( owner && !m_targetAnotherOwner.empty() )
146 {
147 owner = BlueCastPtr( owner->GetEffectChildByName( m_targetAnotherOwner.c_str() ) );
148 }
149
150 if( owner )
151 {
152 owner->RemoveFromEffectChildrenList( m_child );
153 }
154 else
155 {
156 EveMultiEffectPtr effect = BlueCastPtr( controller.GetOwner() );
157 if( effect && !m_targetAnotherOwner.empty() )
158 {
159 EveMultiEffectParameter* mep = effect->GetParameterByName( m_targetAnotherOwner );
160
161 if( !mep )
162 {
163 return;
164 }
165
166 auto obj = mep->GetParameterObject();
167 auto cast = dynamic_cast<IEveEffectChildrenOwner*>( obj );
168 if( cast )
169 {
170 cast->RemoveFromEffectChildrenList( m_child );
171 }
172 }
173 else if( EveStretch3Ptr stretch3 = BlueCastPtr( controller.GetOwner() ) )
174 {
175 IEveEffectChildrenOwnerPtr cast;
176
177 if( m_targetAnotherOwner == BlueSharedString( "SourceSpaceObject" ) )
178 {
179 IEveSpaceObject2Ptr source = stretch3->GetSourceSpaceObject();
180 cast = BlueCastPtr( source );
181 }
182
183 if( m_targetAnotherOwner == BlueSharedString( "DestSpaceObject" ) )
184 {
185 IEveSpaceObject2Ptr dest = stretch3->GetDestSpaceObject();
186 cast = BlueCastPtr( dest );
187 }
188
189 if( cast )
190 {
191 cast->RemoveFromEffectChildrenList( m_child );
192 }
193 }
194 }
195 }
196 m_child = nullptr;

Callers

nothing calls this directly

Calls 8

emptyMethod · 0.80
GetParameterObjectMethod · 0.80
GetSourceSpaceObjectMethod · 0.80
GetDestSpaceObjectMethod · 0.80
GetOwnerMethod · 0.45
GetEffectChildByNameMethod · 0.45
GetParameterByNameMethod · 0.45

Tested by

no test coverage detected