예제 #1
0
        public void Tick()
        {
            StateTransision stateTransision = CheckForTransition();

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

            _currentState.Tick();
        }
예제 #2
0
        public void AddAnyState(IState to, System.Func <bool> condition)
        {
            StateTransision anyStateTransision = new StateTransision(null, to, condition);

            _anyStateTransisions.Add(anyStateTransision);
        }
예제 #3
0
        public void AddTransision(IState from, IState to, System.Func <bool> contidion)
        {
            StateTransision stateTransision = new StateTransision(from, to, contidion);

            _stateTransisions.Add(stateTransision);
        }