| 99 | } |
| 100 | |
| 101 | void Tr2StateMachineState::Link( const Tr2StateMachine& stateMachine ) |
| 102 | { |
| 103 | Unlink(); |
| 104 | |
| 105 | m_stateMachine = &stateMachine; |
| 106 | m_transitionVariableMask = 0; |
| 107 | bool hasMask = true; |
| 108 | for( auto it = begin( m_transitions ); it != end( m_transitions ); ++it ) |
| 109 | { |
| 110 | ( *it )->Link( *this ); |
| 111 | auto mask = ( *it )->GetVariableMask(); |
| 112 | if( mask == 0 ) |
| 113 | { |
| 114 | hasMask = false; |
| 115 | } |
| 116 | else |
| 117 | { |
| 118 | m_transitionVariableMask |= mask; |
| 119 | } |
| 120 | } |
| 121 | if( !hasMask ) |
| 122 | { |
| 123 | m_transitionVariableMask = 0; |
| 124 | } |
| 125 | |
| 126 | for( auto it = begin( m_actions ); it != end( m_actions ); ++it ) |
| 127 | { |
| 128 | ( *it )->Link( *stateMachine.GetController() ); |
| 129 | } |
| 130 | if( m_finalizer ) |
| 131 | { |
| 132 | m_finalizer->Link( *stateMachine.GetController() ); |
| 133 | } |
| 134 | } |
| 135 | |
| 136 | void Tr2StateMachineState::UpdateVariableMask() const |
| 137 | { |
no test coverage detected