✨ ARCANUM RUNE DIFFICULTY: Apprentice Creational

The Factory Method

Deferring the instantiation of undead minions to specialized necro-subroutines.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Factory Method
ARCANUM SCHOOL: Conjuration // Minion-Binding
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// CODEX INCANTATION //
FACTORYMETHOD ; Factory Method Pattern in MUMPS
;
SUMMON(TYPE) ; The Factory Method
  I TYPE="GHOUL" Q $$GHOUL()
  I TYPE="ZOMBIE" Q $$ZOMBIE()
  Q "UNKNOWN ENTITY"
;
GHOUL()
  ; Initialize ghoul attributes in the database
  S ^MINION($J)="GHOUL^AGGRESSIVE^75"
  Q $J
ZOMBIE()
  ; Initialize zombie attributes
  S ^MINION($J)="ZOMBIE^SLOW^100"
  Q $J
Runic Tags: #creational #factory-method #mumps #necromancy