Beispiel #1
0
 // Make sure you init the Machine
 public bool ChangeState(T state)
 {
     if (state.Equals(_CurrentState))
     {
         return(false);
     }
     else
     {
         _CurrentMapping.Exit();
         _CurrentState   = state;
         _CurrentMapping = _StateLookup[state];
         _CurrentMapping.Enter();
         return(true);
     }
 }
Beispiel #2
0
 public void Init(T initState)
 {
     _CurrentState   = initState;
     _CurrentMapping = _StateLookup[initState];
     _CurrentMapping.Enter();
 }