⚡ ZIG ALCHEMY DIFFICULTY: Adept Structural

The Bridge: Dimensional Tether

Decouple an arcane abstraction from its dimensional implementation so both can evolve independently.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Bridge
ARCANUM SCHOOL: Conjuration // Dimensional Tether
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// BLAZING-FAST ZIG ALCHEMY //
const std = @import("std");

pub const SpellEngine = struct {
    vtable: *const VTable,
    pub const VTable = struct {
        ignite: *const fn (self: *SpellEngine) void,
    };
    pub fn ignite(self: *SpellEngine) void { self.vtable.ignite(self); }
};

pub const Spell = struct {
    engine: *SpellEngine,

    pub fn cast(self: *Spell) void {
        self.engine.ignite();
    }
};

A Dimensional Tether connects the theoretical structure of a Spell to the raw SpellEngine powering it. By isolating the interface from the implementation, alchemists can swap out the rendering or physics engine of their magic on the fly, keeping the core sigil logic untouched.

Runic Tags: #bridge #structural #zig #dimensions