The Builder of the Hypertext Labyrinth
Step-by-step construction of complex, multi-layered story nodes.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Builder
ARCANUM SCHOOL: Transmutation // Architecture
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// TWINE PATTERN //
:: Widget: LabyrinthBuilder [widget]
<<widget "initNodeBuilder">>
<<set $builder to {
title: "Unknown",
text: "",
exits: [],
hazards: []
}>>
<</widget>>
<<widget "setTitle">>
<<set $builder.title to _args[0]>>
<</widget>>
<<widget "addText">>
<<set $builder.text to $builder.text + _args[0] + " ">>
<</widget>>
<<widget "addExit">>
<<run $builder.exits.push({ destination: _args[0], label: _args[1] })>>
<</widget>>
<<widget "buildNode">>
<<return clone($builder)>>
<</widget>>
:: Usage
<<initNodeBuilder>>
<<setTitle "The Data Core">>
<<addText "A humming server pillar extends into the infinite darkness.">>
<<addExit "Mainframe" "Jack In">>
<<set $dataCoreNode to buildNode()>>
Constructing complex, trap-laden nodes in the Hypertext Labyrinth in a single breathless incantation risks syntax collapse and chronological fracturing. The Builder pattern isolates the creation process.
With this structure, the Architect weaves title, lore, exits, and traps step-by-step, assembling a fully-formed digital room in the $builder buffer before solidifying it into the $dataCoreNode reality matrix. It separates the intricate construction of the hypertext from its final representation.
Runic Tags:
#creational
#builder
#data-structures