🌙 LUA GLYPH DIFFICULTY: Adept Behavioral

The Memento of Chronomancy

Capturing and restoring the internal state of a spellbook through time.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Memento
ARCANUM SCHOOL: Transmutation // Chronomancy
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// LUA PATTERN //
local Spellbook = { activeSpell = "None" }

function Spellbook:save()
  return { state = self.activeSpell }
end

function Spellbook:restore(memento)
  self.activeSpell = memento.state
end

Spellbook.activeSpell = "Fireball"
local timeCrystal = Spellbook:save()

Spellbook.activeSpell = "Invisibility"
Spellbook:restore(timeCrystal)
print("Restored Spell: " .. Spellbook.activeSpell)

Memento

Chronomancy demands precision. The Memento pattern captures a snapshot of a Lua table’s essence—crystallizing its state at a specific moment. This time crystal can be safely held by the host engine and later crushed to restore the spellbook exactly as it was.

Runic Tags: #fae #memento #state-saving