public void SetLocked()
 {
     currentState = lockedState;
 }
 public void SetUnlocked()
 {
     currentState = unlockedState;
 }
Beispiel #3
0
 public TurnstileContextDecorator(ITurnstileState initialState)
 {
     this.state = initialState;
 }
Beispiel #4
0
 public ITurnstileState Alarm() => state = state.Alarm();
Beispiel #5
0
 public ITurnstileState PayFailed() => state = state.PayFailed();
Beispiel #6
0
 public ITurnstileState PayOk() => state = state.PayOk();
Beispiel #7
0
 public ITurnstileState Enter() => state = state.Enter();
 public void SetUnlocked()
 {
     state = unlockedState;
 }
 public void SetLocked()
 {
     state = lockedState;
 }
 public void ChangeState(ITurnstileState state)
 {
     State = state;
 }
 // always instance the class with an initial default state - closed
 public Turnstile()
 {
     State = new ClosedTurnstileState(this);
 }