Exemplo n.º 1
0
        /// <summary>
        /// 状态转变事件函数
        /// </summary>
        /// <param name="act"></param>
        private void instOnTransitionedAction(StateMachine <StateInst, TriggerInst> .Transition act)
        {
            nlogger.Debug("On StateInst Transitioned.");

            TriggerInst trigger = act.Trigger;
            StateInst   source  = act.Source;
            StateInst   dest    = act.Destination;

            // 状态清零
            _instStateCounts = 0;

            // 触发事件 - 状态转变
            StateChangedEvent?.Invoke(dest);
        }
Exemplo n.º 2
0
 /// <summary>
 /// 未定义事件函数
 /// </summary>
 /// <param name="st"></param>
 /// <param name="tg"></param>
 private void instOnUnhandledTrigger(StateInst st, TriggerInst tg)
 {
     nlogger.Error("Inst Unhandled trigger: state.");
 }