public void RestoreState()
 {
     if (nextState != null && nextState.nextState == null)
     {
         if (nextState.TmpExciteStateEvent != null)
         {
             nextState.TmpRestoreStateEvent.Invoke(nextState.NowValue);
         }
         nextState = null;
     }
     else if (nextState != null)
     {
         nextState.RestoreState();
     }
 }
Beispiel #2
0
 public void ReductionState()
 {
     if (nextState != null && nextState.nextState == null)
     {
         if (nextState.TmpChangeStateEvent != null)
         {
             nextState.TmpReductionStateEvent.Invoke(nextState.NowValue);
         }
         nextState = null;
     }
     else if (nextState != null)
     {
         nextState.ReductionState();
     }
 }
 public void ExciteState(T nowValue, Action <T> changeStateEvent, Action <T> reductionStateEvent)
 {
     if ((IsTop || nextState == null) && TmpExciteStateEvent != null)
     {
         TmpExciteStateEvent.Invoke(nowValue);
     }
     if (nextState == null)
     {
         nextState       = new RecursiveState <T>(nowValue, changeStateEvent, reductionStateEvent);
         nextState.IsTop = false;
     }
     else
     {
         nextState.ExciteState(nowValue);
     }
 }
 public void ExciteState(T nowValue)
 {
     if ((IsTop || nextState == null) && TmpExciteStateEvent != null)
     {
         TmpExciteStateEvent.Invoke(nowValue);
     }
     if (nextState == null)
     {
         nextState       = new RecursiveState <T>(nowValue);
         nextState.IsTop = false;
     }
     else
     {
         nextState.ExciteState(nowValue);
     }
 }