🧱 B PRECURSOR DIFFICULTY: Apprentice Behavioral

The Memento

Capturing the internal state of a primordial rune to restore it post-calamity.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Memento
ARCANUM SCHOOL: Chronomancy // Restoration
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// B PATTERN //
/* The artifact whose memory alters over time */
ext artifact_power;

save_memento(mem_slot) {
    mem_slot[0] = artifact_power;
}

restore_memento(mem_slot) {
    artifact_power = mem_slot[0];
}

temporal_shift() {
    auto safe_state[1];

    artifact_power = 100;
    save_memento(safe_state);

    artifact_power = 0; /* Calamity strikes */

    restore_memento(safe_state); /* Order restored */
}
Runic Tags: #b #design-pattern #precursor #bell-labs-magic #untyped