public void ChangeState(T nowValue) { if (ChangeStateEvent != null) { ChangeStateEvent.Invoke(nowValue); } if (TmpChangeStateEvent != null) { TmpChangeStateEvent.Invoke(nowValue); } NowValue = nowValue; IsSpecial = true; }
public void ChangeState(T nowValue, Action <T> changeStateEvent, Action <T> reductionStateEvent) { if ((IsTop || nextState == null) && TmpChangeStateEvent != null) { TmpChangeStateEvent.Invoke(nowValue); } if (nextState == null) { nextState = new RecursiveState <T>(nowValue, changeStateEvent, reductionStateEvent); nextState.IsTop = false; } else { nextState.ChangeState(nowValue); } }