The Memento Chronosphere
Capturing and restoring the state of a localized temporal field.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Memento
ARCANUM SCHOOL: Chronomancy // Time-Weaving
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// EIFFEL PATTERN //
class
TIME_MEMENTO
feature {CHRONOMANCER}
state: STRING
make (s: STRING)
do
state := s
end
end
class
CHRONOMANCER
feature
current_state: STRING
save_time: TIME_MEMENTO
do
create Result.make (current_state)
end
restore_time (m: TIME_MEMENTO)
do
current_state := m.state
end
end
A Memento safely encapsulates the state of the timestream, ensuring a chronomancer can revert to a prior state without exposing its internal temporal gears.
Runic Tags:
#behavioral
#memento
#eiffel