| 266 | } |
| 267 | |
| 268 | void 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 | |
| 293 | void Tr2StateMachineState::Stop() |
| 294 | { |
no test coverage detected