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

Method Stop

trinity/Controllers/Tr2StateMachineState.cpp:293–321  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

291}
292
293void Tr2StateMachineState::Stop()
294{
295 if( !m_isActive || m_isFinalizing )
296 {
297 return;
298 }
299 if( m_stateMachine )
300 {
301 auto owner = m_stateMachine->GetController() != nullptr ? m_stateMachine->GetController()->GetOwner() : nullptr;
302 for( auto it = begin( m_actions ); it != end( m_actions ); ++it )
303 {
304 ContinueOnMainThread( [_ = IRootPtr( owner ), action = ITr2ControllerActionPtr( *it ), self = Tr2StateMachineStatePtr( this )]() {
305 if( self->m_stateMachine && action )
306 {
307 action->Stop( *self->m_stateMachine->GetController() );
308 }
309 } );
310 }
311 if( m_finalizer )
312 {
313 if( !m_finalizer->CanTransition( *m_stateMachine->GetController() ) )
314 {
315 m_isFinalizing = true;
316 return;
317 }
318 }
319 }
320 m_isActive = false;
321}
322
323IRoot* Tr2StateMachineState::GetStateMachinePtr() const
324{

Callers 1

OnListModifiedMethod · 0.45

Calls 6

ContinueOnMainThreadFunction · 0.85
GetControllerMethod · 0.80
beginFunction · 0.50
endFunction · 0.50
GetOwnerMethod · 0.45
CanTransitionMethod · 0.45

Tested by

no test coverage detected