/// <summary> /// Sets the current state, use with empty ctor /// </summary> /// <param name="state">state to set</param> public void SetState(State state) { if (state != null) state.Initialize(); _currentState = state; }
/// <summary> /// Constructor that defines initial state /// </summary> /// <param name="initialState">initial state to set</param> public StateContext(State initialState) { SetState(initialState); }