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

Method OnListModified

trinity/Controllers/Tr2StateMachine.cpp:35–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35void Tr2StateMachine::OnListModified( long event, ssize_t key, ssize_t key2, IRoot* value, const IList* list )
36{
37 if( list == &m_states )
38 {
39 switch( event & BELIST_EVENTMASK )
40 {
41 case BELIST_INSERTED:
42 if( m_controller )
43 {
44 if( Tr2StateMachineStatePtr state = BlueCastPtr( value ) )
45 {
46 state->Link( *this );
47 }
48 }
49 break;
50 case BELIST_REMOVED:
51 if( Tr2StateMachineStatePtr state = BlueCastPtr( value ) )
52 {
53 if( state == m_currentState )
54 {
55 state->Stop();
56 }
57 m_currentState = m_startState;
58 m_stateStartTime = BeOS->GetCurrentFrameTime();
59 if( m_currentState )
60 {
61 m_currentState->Start();
62 }
63 state->Unlink();
64 }
65 break;
66 default:
67 break;
68 }
69 }
70}
71
72bool Tr2StateMachine::OnModified( Be::Var* value )
73{

Callers

nothing calls this directly

Calls 4

LinkMethod · 0.45
StopMethod · 0.45
StartMethod · 0.45
UnlinkMethod · 0.45

Tested by

no test coverage detected