Esempio n. 1
0
 public void UpdateState()
 {
     if (currentState != null)
     {
         currentState.Execute();
     }
 }
Esempio n. 2
0
        private void ChangeState(TStateType state)
        {
            if (state == null)
            {
                _stateMachine.Stop();
                return;
            }
            var newState = _stateFactory.Create(state);

            _stateMachine.Execute(newState);
        }
Esempio n. 3
0
            //in the state patten, this is used to execute the current state
            //not sure if this is relevant to this system???
            public void Update()
            {
                if ((currentState == null))
                {
                    throw new Exception("currentState state is null");
                }

                string buf = currentState.ToString();

                IemUtils.SLog(this.GetType().Name + ":Executing:" + buf);
                currentState.Execute(this);
                IemUtils.SLog(this.GetType().Name + ":Executed:" + buf);
            }
Esempio n. 4
0
        protected virtual void ChangeState(TStateType state)
        {
            var stateBehaviour = _stateFactory.Create(state);

            _stateMachine.Execute(stateBehaviour);
        }