🎞️ ACTIONSCRIPT WARD DIFFICULTY: Apprentice Structural

The Proxy

A spectral stand-in for an abyssal entity that is too heavy to summon immediately.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Proxy
ARCANUM SCHOOL: Illusion // Deferred Summoning
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// ACTIONSCRIPT PATTERN //
package arcana.proxy {

    public interface IDemon {
        function unleash():void;
    }

    public class BehemothDemon implements IDemon {
        public function BehemothDemon() {
            trace("Heavy loading... Summoning the Behemoth from the void (Takes 10 seconds).");
            // Imagine heavy asset loading here
        }

        public function unleash():void {
            trace("The Behemoth crushes the stage!");
        }
    }

    public class BehemothProxy implements IDemon {
        private var realDemon:BehemothDemon;

        public function unleash():void {
            if (realDemon == null) {
                trace("Proxy: Initializing the real Behemoth only when needed.");
                realDemon = new BehemothDemon();
            }
            realDemon.unleash();
        }
    }
}
Runic Tags: #proxy #actionscript #flash #deferred-loading