The Command of the Sealed Scroll
Encapsulating a spell as an object to be stored, passed, and executed at will.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Command
ARCANUM SCHOOL: Evocation // Scrolls
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// LUA PATTERN //
local function CommandScroll(action, target)
return {
execute = function()
action(target)
end
}
end
local function castFireball(target)
print("A fiery explosion strikes " .. target .. "!")
end
local scroll = CommandScroll(castFireball, "the Goblin")
-- Store for later
scroll.execute()
Command
Through the magic of Lua closures, the Command pattern binds an action and its targets into a single Sealed Scroll. This symbiotic script can be handed to the host engine, queued, delayed, or reversed, executing its Fae Moon Glyphs only when the time is right.
Runic Tags:
#fae
#command
#execution