예제 #1
0
        public bool HandleEvent <TTransition>()
        {
            var transition = mTrasitionTable.TypeIndex.Get(typeof(TTransition)).First();

            if (transition.SrcStateType == CurrentState.GetType())
            {
                CurrentState.Exit();
                CurrentState = mStates[transition.DstStateType];
                CurrentState.Enter();
                return(true);
            }

            return(false);
        }
예제 #2
0
 public void StartState <T>()
 {
     CurrentState = mStates[typeof(T)];
     CurrentState.Enter();
 }
예제 #3
0
 public void ChangeState <TState>()
 {
     CurrentState.Exit();
     CurrentState = mStates[typeof(TState)];
     CurrentState.Enter();
 }