✨ ARCANUM RUNE DIFFICULTY: Adept Creational

Factory Method for Sprite Enchantment

Defer the exact manifestation of a sprite enchantment to subclasses.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Factory Method
ARCANUM SCHOOL: Conjuration // Sprite Enchantment
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// CODEX INCANTATION //
function SpriteSpawner() constructor {
    static create_enchantment = function() { 
        // Abstract method, must be overridden by true conjurers
        return undefined; 
    };
    
    static spawn_and_apply = function(_target_x, _target_y) {
        var enchantment = create_enchantment();
        enchantment.apply_at(_target_x, _target_y);
    };
}

function CursedSpriteSpawner() : SpriteSpawner() constructor {
    static create_enchantment = function() {
        return new CursedEnchantment();
    };
}

By trusting the Factory Method, base rituals dictate the flow of summoning while specific covens override the exact essence spawned, ensuring variations of sprites seamlessly integrate into the grand orchestration.

Runic Tags: #gml #creational #factory-method