public void SetState(AbstractState s) { current = s; }
/// <summary> /// Initializes a new instance of the <see cref="Context"/> class. /// </summary> /// <param name="state"> /// The state. /// </param> public Context(AbstractState state) { this.State = state; }
public Work() { current = new ForenoonState(); }
// Overloaded constructors public GoldState(AbstractState state) : this(state.Balance, state.Account) { }
public void SetState(AbstractState state) { _state = state; }
public void StateTransitionAction2() { this.state = new StateB(); this.state.SetContext(this); }
public Context() { this.state = new DefaultState(); }
// Overloaded constructors public SilverState(AbstractState state) : this(state.Balance, state.Account) { }