Example #1
0
 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;
 }
Example #3
0
 public Work()
 {
     current = new ForenoonState();
 }
Example #4
0
        // 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();
 }
Example #8
0
        // Overloaded constructors


        public SilverState(AbstractState state) :
            this(state.Balance, state.Account)
        {
        }