EN: Restores the Originator's state from a memento object. RU: Восстанавливает состояние Создателя из объекта снимка.
(self, memento: Memento)
| 71 | return ConcreteMemento(self._state) |
| 72 | |
| 73 | def restore(self, memento: Memento) -> None: |
| 74 | """ |
| 75 | EN: Restores the Originator's state from a memento object. |
| 76 | |
| 77 | RU: Восстанавливает состояние Создателя из объекта снимка. |
| 78 | """ |
| 79 | |
| 80 | self._state = memento.get_state() |
| 81 | print(f"Originator: My state has changed to: {self._state}") |
| 82 | |
| 83 | |
| 84 | class Memento(ABC): |