Пример #1
0
        public CastleProcessState GetNext(CastleCommand command)
        {
            StateTransition    transition = new StateTransition(CurrentState, command);
            CastleProcessState nextState;

            if (!transitions.TryGetValue(transition, out nextState))
            {
                throw new Exception("Invalid transition: " + CurrentState + " -> " + command);
            }
            return(nextState);
        }
Пример #2
0
 public CastleProcessState MoveNext(CastleCommand command)
 {
     CurrentState = GetNext(command);
     return(CurrentState);
 }
Пример #3
0
 public StateTransition(CastleProcessState currentState, CastleCommand command)
 {
     CurrentState = currentState;
     Command      = command;
 }