Пример #1
0
        public void Tick()
        {
            StateTransition stateTransition = CheckForTransition();

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

            _currentState.Tick();
        }
Пример #2
0
        public void AddAnyState(IState to, System.Func <bool> condition)
        {
            StateTransition anyStateTransition = new StateTransition(null, to, condition);

            _anyStateTransitions.Add(anyStateTransition);
        }
Пример #3
0
        public void AddTransition(IState from, IState to, System.Func <bool> contidion)
        {
            StateTransition stateTransition = new StateTransition(from, to, contidion);

            _stateTransitions.Add(stateTransition);
        }