Exemple #1
0
        public void Tick()
        {
            StateTransition transition = CheckForTransition();

            if (transition != null)
            {
                SetState(transition.ToNewState);
            }

            CurrentState.Tick();
        }
Exemple #2
0
        public void AddAnyTransition(IState to, Func <bool> predicate)
        {
            var stateTranisions = new StateTransition(null, to, predicate);

            _anyStateTransitions.Add(stateTranisions);
        }
Exemple #3
0
        public void AddTransition(IState from, IState to, Func <bool> predicate)
        {
            var stateTransition = new StateTransition(from, to, predicate);

            _stateTransitions.Add(stateTransition);
        }