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

Method OnListModified

trinity/Controllers/Tr2Controller.cpp:36–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36void Tr2Controller::OnListModified( long event, ssize_t key, ssize_t key2, IRoot* value, const IList* list )
37{
38 if( list == &m_stateMachines )
39 {
40 switch( event & BELIST_EVENTMASK )
41 {
42 case BELIST_INSERTED:
43 if( m_owner )
44 {
45 if( Tr2StateMachinePtr stateMachine = BlueCastPtr( value ) )
46 {
47 stateMachine->Link( *this );
48 if( m_isActive )
49 {
50 stateMachine->Start();
51 }
52 }
53 }
54 break;
55 case BELIST_REMOVED:
56 if( Tr2StateMachinePtr stateMachine = BlueCastPtr( value ) )
57 {
58 if( m_isActive )
59 {
60 stateMachine->Stop();
61 }
62 stateMachine->Unlink();
63 }
64 break;
65 default:
66 break;
67 }
68 }
69 else if( list == &m_eventHandlers )
70 {
71 switch( event & BELIST_EVENTMASK )
72 {
73 case BELIST_INSERTED:
74 if( m_owner )
75 {
76 if( Tr2ControllerEventHandlerPtr handler = BlueCastPtr( value ) )
77 {
78 handler->Link( *this );
79 }
80 }
81 break;
82 case BELIST_REMOVED:
83 if( Tr2ControllerEventHandlerPtr handler = BlueCastPtr( value ) )
84 {
85 handler->Unlink();
86 }
87 break;
88 default:
89 break;
90 }
91 }
92 else if( list == &m_variables )
93 {

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected