Beispiel #1
0
 public Gate()
 {
     OpenedState      = new OpenState(this);
     ClosedState      = new CloseState(this);
     LockedState      = new LockState(this);
     UnlockedState    = new UnLockState(this);
     CurrentGateState = OpenedState;
 }
Beispiel #2
0
        public void Add(IGateState gateState, int gateNr)
        {
            if (_gateStateItems.ContainsKey(gateNr))
            {
                throw new ArgumentException($"An item with gate number {gateNr} already exist.");
            }

            _gateStateItems.Add(gateNr, gateState);
        }
Beispiel #3
0
 public void Enter()
 {
     this.gateState = gateState.Enter();
 }
Beispiel #4
0
 public void PayFail()
 {
     this.gateState = gateState.PayFail();
 }
Beispiel #5
0
 public void PayOk()
 {
     this.gateState = gateState.PayOk();
 }
Beispiel #6
0
 public void Enter()
 {
     this.state = this.state.Enter();
 }
Beispiel #7
0
 public void PayFailed()
 {
     this.state = this.state.PayFailed();
 }
 public void PayFailed()
 {
     this.gateState = this.gateState.PayFailed();
 }
Beispiel #9
0
 public void ChangeState(IGateState newState)
 {
     this.state = newState;
 }
Beispiel #10
0
 public void ChangeState(IGateState state)
 {
     _state = state;
 }
Beispiel #11
0
 public Gate()
 {
     _state = new ClosedState(this);
 }
Beispiel #12
0
 public void ChangeState(IGateState newState)
 {
     Console.WriteLine($"Changing gate state to {newState.GetType().Name}");
     _state = newState;
 }
Beispiel #13
0
 public Gate(int neededPayment)
 {
     _neededPayment = neededPayment;
     _state         = new ClosedGateState();
 }
Beispiel #14
0
 public Gate()
 {
     this.state = new ClosedGateState(this);
 }
Beispiel #15
0
 public void PayOk()
 {
     this.state = this.state.PayOk();
 }
Beispiel #16
0
 public void ChangeState(IGateState s)
 {
     this.state = s;
 }
 public Gate(IGateState gateState)
 {
     this.gateState = gateState;
 }