Пример #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;
 }
Пример #3
0
 public Work()
 {
     current = new ForenoonState();
 }
Пример #4
0
        // Overloaded constructors

        public GoldState(AbstractState state)
            : this(state.Balance, state.Account)
        {
        }
 public void SetState(AbstractState state)
 {
     _state = state;
 }
Пример #6
0
 public void StateTransitionAction2()
 {
     this.state = new StateB();
     this.state.SetContext(this);
 }
Пример #7
0
 public Context()
 {
     this.state = new DefaultState();
 }
Пример #8
0
        // Overloaded constructors


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