Exemplo n.º 1
0
        public void Tick()
        {
            StateTransition stateTransition = CheckForTransition();

            if (stateTransition != null)
            {
                SetState(stateTransition.To);
            }

            _currentState.Tick();
        }
Exemplo n.º 2
0
        public void AddAnyState(IState to, System.Func <bool> condition)
        {
            StateTransition anyStateTransition = new StateTransition(null, to, condition);

            _anyStateTransitions.Add(anyStateTransition);
        }
Exemplo n.º 3
0
        public void AddTransition(IState from, IState to, System.Func <bool> contidion)
        {
            StateTransition stateTransition = new StateTransition(from, to, contidion);

            _stateTransitions.Add(stateTransition);
        }