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

Method Link

trinity/Controllers/Tr2StateMachineState.cpp:101–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101void 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
136void Tr2StateMachineState::UpdateVariableMask() const
137{

Callers 2

OnModifiedMethod · 0.45
OnListModifiedMethod · 0.45

Calls 4

GetControllerMethod · 0.80
beginFunction · 0.50
endFunction · 0.50
GetVariableMaskMethod · 0.45

Tested by

no test coverage detected