🧱 B PRECURSOR DIFFICULTY: Adept Behavioral

The Mediator

Centralizing the dark communication between precursor components.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Mediator
ARCANUM SCHOOL: Enchantment // Domination
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// B PATTERN //
/* Components speak only to the nexus */

ext component_a_val, component_b_val;

mediator_notify(sender, event) {
    if (sender == 'A') {
        if (event == 'SYNC') component_b_val = component_a_val;
    }
    if (sender == 'B') {
        if (event == 'WAKE') component_a_val = 1;
    }
}

comp_a_act() {
    component_a_val = 99;
    mediator_notify('A', 'SYNC');
}

comp_b_act() {
    mediator_notify('B', 'WAKE');
}
Runic Tags: #b #design-pattern #precursor #bell-labs-magic #untyped