Ejemplo n.º 1
0
 /// <summary>
 /// 所有事件全部添加完毕
 /// </summary>
 public void AddAlready()
 {
     addAlready = true;
     if (nextState == null)
     {
         MainRestore.Invoke();
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 还原状态(一个事件已完成)
        /// </summary>
        /// <param name="token"></param>
        public void RestoreState(T token)
        {
            if (nextState.StateToken as object == token as object)
            {
                nextState = nextState.nextState;

                if (isFirst)
                {
                    if (EachRestore != null)
                    {
                        EachRestore.Invoke(token);
                    }
                    if (nextState == null && addAlready)
                    {
                        MainRestore.Invoke();
                    }
                }
            }
            else
            {
                nextState.RestoreState(token);
            }
        }