💎 CRYSTAL GEM DIFFICULTY: Adept Creational

The Builder: Faceting the Monolith

Separating the construction of a complex crystal structure from its final representation.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Builder
ARCANUM SCHOOL: Conjuration // Crystalline Form
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// CRYSTAL PATTERN //
class Monolith
  property core : String = ""
  property facets : Int32 = 0
  property aura : String = ""

  def manifest
    "A Monolith with a #{core} core, #{facets} facets, radiating a #{aura} aura."
  end
end

abstract class MonolithBuilder
  abstract def build_core
  abstract def carve_facets
  abstract def enchant_aura
  abstract def monolith : Monolith
end

class ObsidianBuilder < MonolithBuilder
  @monolith = Monolith.new

  def build_core
    @monolith.core = "Void"
  end

  def carve_facets
    @monolith.facets = 8
  end

  def enchant_aura
    @monolith.aura = "Shadow"
  end

  def monolith : Monolith
    @monolith
  end
end

class QuartzBuilder < MonolithBuilder
  @monolith = Monolith.new

  def build_core
    @monolith.core = "Light"
  end

  def carve_facets
    @monolith.facets = 32
  end

  def enchant_aura
    @monolith.aura = "Prismatic"
  end

  def monolith : Monolith
    @monolith
  end
end

class ArchmageDirector
  property builder : MonolithBuilder?

  def construct_monolith
    if b = @builder
      b.build_core
      b.carve_facets
      b.enchant_aura
    end
  end
end

director = ArchmageDirector.new
builder = ObsidianBuilder.new
director.builder = builder
director.construct_monolith
puts builder.monolith.manifest

The Builder incantation allows an Archmage to separate the intricate steps of carving and enchanting a monolith from its final state. By passing a specific builder (like Quartz or Obsidian) to the director, the same construction ritual yields profoundly different magical constructs.

Runic Tags: #creational #builder #crystal #monolith