Пример #1
0
 // This constructor will create new state taking values from old state
 public YellowState(TrafficLightState state)
     : this(state.TrafficLightProperty)
 {
 }
Пример #2
0
 // This constructor will create new state taking values from old state
 public RedState(TrafficLightState state)
     : this(state.TrafficLightProperty)
 {
 }
Пример #3
0
 public TrafficLight()
 {
     currentState = new GreenState(this);
 }