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

Method Start

trinity/Controllers/Tr2StateMachineState.cpp:268–291  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

266}
267
268void Tr2StateMachineState::Start()
269{
270 if( m_isActive )
271 {
272 return;
273 }
274 if( m_stateMachine )
275 {
276 auto owner = m_stateMachine->GetController() != nullptr ? m_stateMachine->GetController()->GetOwner() : nullptr;
277
278 for( auto it = begin( m_actions ); it != end( m_actions ); ++it )
279 {
280 ContinueOnMainThread( [_ = IRootPtr( owner ), action = ITr2ControllerActionPtr( *it ), self = Tr2StateMachineStatePtr( this )]() {
281 if( self->m_stateMachine && action )
282 {
283 action->Start( *self->m_stateMachine->GetController() );
284 }
285 } );
286 }
287 m_isActive = true;
288 m_isFinalizing = false;
289 m_hasBeenVetoed = false;
290 }
291}
292
293void Tr2StateMachineState::Stop()
294{

Callers 1

OnListModifiedMethod · 0.45

Calls 5

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

Tested by

no test coverage detected