❄️ COLDFUSION TAG DIFFICULTY: Adept Structural

The Decorator of the Enchanted Layers

Dynamically attach additional wards and enchantments to an apparition.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Decorator
ARCANUM SCHOOL: Abjuration // Wards
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// COLDFUSION PATTERN //
interface name="IApparition" {
    public string manifest();
}

component name="BaseGhost" implements="IApparition" {
    public string function manifest() {
        return "A ghostly figure appears.";
    }
}

component name="ApparitionDecorator" implements="IApparition" {
    variables.wraith = "";

    public ApparitionDecorator function init(IApparition wraith) {
        variables.wraith = arguments.wraith;
        return this;
    }

    public string function manifest() {
        return variables.wraith.manifest();
    }
}

component name="FlamingEnchantment" extends="ApparitionDecorator" {
    public string function manifest() {
        return super.manifest() & " It is wreathed in green fire!";
    }
}

By wrapping a base ghost in decorators, the alchemist can dynamically stack wards. Need a flaming, poison-dripping, ethereal ghost? Simply nest the decorators. The underlying apparition remains oblivious to the immense dark powers layered upon it.

Runic Tags: #decorator #coldfusion #enchantments #wrappers