State Transitions:?
- Each time the Change method is called, the current state will perform its
action and then set the next state, allowing the traffic light to cycle through its
states (Red → Green → Yellow → Red).
Benefits of the State Pattern:
action and then set the next state, allowing the traffic light to cycle through its
states (Red → Green → Yellow → Red).
Benefits of the State Pattern: