public void UpdateState() { if (currentState != null) { currentState.Execute(); } }
private void ChangeState(TStateType state) { if (state == null) { _stateMachine.Stop(); return; } var newState = _stateFactory.Create(state); _stateMachine.Execute(newState); }
//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); }
protected virtual void ChangeState(TStateType state) { var stateBehaviour = _stateFactory.Create(state); _stateMachine.Execute(stateBehaviour); }