The Memento Hex
Capturing temporal snapshots of a magical state.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Memento
ARCANUM SCHOOL: Chronomancy // Snapshot
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// KOTLIN PATTERN //
data class SoulMemento(val state: String)
class Wizard(var state: String) {
fun save(): SoulMemento = SoulMemento(state)
fun restore(memento: SoulMemento) {
this.state = memento.state
}
}
class SoulStone {
var savedState: SoulMemento? = null
}
The Memento Hex
Chronomancy is a delicate art. To revert to a previous timeline without violating encapsulation, we employ the Memento Hex. It stores an immutable snapshot of an entity’s internal state—a Soul Stone—that can be safely held by an external caretaker and used to restore the wizard if their corporeal form is corrupted.
Runic Tags:
#kotlin
#behavioral
#memento