The State
Morph the behavior of a xenomorph based on its metamorphic phase.
β§ GANG OF FOUR LINEAGE & ARCANUM β§
GOF DESIGN PATTERN: State
ARCANUM SCHOOL: Transmutation // Metamorphic-Phases
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// APL PATTERN //
:Class Phase
β React Context
:Access Public Shared
β
:EndClass
:Class LarvalPhase : Phase
β React Context
:Access Public
β β 'Scurrying in shadows... β'
Context.SetPhase βNEW DronePhase
β
:EndClass
:Class DronePhase : Phase
β React Context
:Access Public
β β 'Building hive structures... β'
β
:EndClass
:Class Xenomorph
:Field Private CurrentPhase
β Make
:Access Public
:Implements Constructor
CurrentPhase β βNEW LarvalPhase
β
β SetPhase P
:Access Public
CurrentPhase β P
β
β Act
:Access Public
CurrentPhase.React βTHIS
β
:EndClass
An alien xenomorph does not rely on complex conditional logic to dictate its actions; instead, it completely replaces its internal psychic structure as it matures. The State pattern encapsulates each life stageβLarvalPhase (β) and DronePhase (β). When the entity triggers an action (Act), it delegates to its active phase matrix, seamlessly mutating its behavior as it transitions through its metamorphic cycle.
Runic Tags:
#apl
#behavioral
#alien
#state
#xenomorph