| 100 | |
| 101 | |
| 102 | class ConcreteStateA(State): |
| 103 | def handle1(self) -> None: |
| 104 | print("ConcreteStateA handles request1.") |
| 105 | print("ConcreteStateA wants to change the state of the context.") |
| 106 | self.context.transition_to(ConcreteStateB()) |
| 107 | |
| 108 | def handle2(self) -> None: |
| 109 | print("ConcreteStateA handles request2.") |
| 110 | |
| 111 | |
| 112 | class ConcreteStateB(State): |