✨ ARCANUM RUNE DIFFICULTY: Adept Creational

Singleton for Sprite Enchantment

Ensure a solitary locus for the administration of sprite enchantments.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Singleton
ARCANUM SCHOOL: Abjuration // Sprite Enchantment
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// CODEX INCANTATION //
function EnchantmentManager() constructor {
    active_enchantments = [];
    
    static get_instance = function() {
        static _instance = new EnchantmentManager();
        return _instance;
    };
    
    static register = function(_enchantment) {
        array_push(active_enchantments, _enchantment);
    };
}

// Invocation
var manager = EnchantmentManager().get_instance();

The Singleton binds the chaotic aether to a single focal point. Through this pattern, there is only one overseer of all sprite enchantments in the realm, preventing redundant magical conflicts.

Runic Tags: #gml #creational #singleton