Exemplo n.º 1
0
        public void Next(StateCommand prevState)
        {
            NextStatePair pair = null;

            if (prevState != null)
            {
                pair = _stateFlow.Find(delegate(NextStatePair nextStatePair)
                {
                    return(nextStatePair.Target == prevState.GetType());
                });
            }

            if (pair != null)
            {
                if (prevState.FinishedWithSuccess)
                {
                    _stateMachine.ApplyState(pair.Success, _container);
                }
                else
                {
                    _stateMachine.ApplyState(pair.Fail, _container);
                }
            }
        }
Exemplo n.º 2
0
 public void Add(NextStatePair pair)
 {
     _stateFlow.Add(pair);
 }