The State of the Lycanthrope
Allow an apparition to alter its behavior when its internal state changes, appearing to change its class.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: State
ARCANUM SCHOOL: Transmutation // Shapeshifting
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// COLDFUSION PATTERN //
interface name="IMoonPhase" {
public void act();
}
component name="HumanForm" implements="IMoonPhase" {
public void function act() { writeOutput("Speaks normally."); }
}
component name="WolfForm" implements="IMoonPhase" {
public void function act() { writeOutput("Howls at the moon!"); }
}
component name="Lycanthrope" {
variables.currentState = new HumanForm();
public void function setPhase(IMoonPhase phase) {
variables.currentState = arguments.phase;
}
public void function performAction() {
variables.currentState.act();
}
}
The Lycanthrope’s internal logic is not a mess of if/else checks against the moon’s phase. Instead, it delegates its behavior to a state object. As the environment shifts, the alchemist swaps the internal tag-ward, and the entity instantly transfigures from man to beast.
Runic Tags:
#state
#coldfusion
#shapeshifting
#state-machine