🅓 D SORCERY DIFFICULTY: Adept Structural

Bridge

Decouple a spell's abstraction from its elemental implementation so the two can vary independently.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Bridge
ARCANUM SCHOOL: Evocation // Aspect Separation
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// D PATTERN //
interface ElementalCore { string channel(); }
class FireCore : ElementalCore { override string channel() { return "Fire"; } }

abstract class SpellForm {
    protected ElementalCore core;
    this(ElementalCore c) { core = c; }
    abstract void invoke();
}

class BlastForm : SpellForm {
    this(ElementalCore c) { super(c); }
    override void invoke() { /* Use core.channel() */ }
}

Separates a magical form from its raw elemental source.

Runic Tags: #structural #bridge #dlang #abstraction