/// <summary>
 /// 进入状态时的回调
 /// </summary>
 /// <param name="prev">上一个状态</param>
 public override void EnterCallback(IState prev)
 {
     base.EnterCallback(prev);
     _currentState.EnterCallback(prev);
 }
 /// <summary>
 /// 构造方法
 /// </summary>
 public LStateMachine(string name, IState defaultState) : base(name)
 {
     _states       = new List <IState> ();
     _defaultState = defaultState;
 }
 /// <summary>
 /// 退出状态时的回调
 /// </summary>
 /// <param name="next">下一个状态</param>
 public override void ExitCallback(IState next)
 {
     base.ExitCallback(next);
     _currentState.ExitCallback(next);
 }
Exemple #4
0
 //构造函数
 public Transition(string name, IState fromState, IState toState)
 {
     _name      = name;
     _fromState = fromState;
     _toState   = toState;
 }
Exemple #5
0
 public LOStateMeachine(string name, IState state)
     : base(name)
 {
     _states      = new List <IState>();
     DefaultState = state;
 }
Exemple #6
0
 //构造函数
 public SUNTransition(string name, IState from, IState to)
 {
     this._name = name;
     this._from = from;
     this._to   = to;
 }