The Template Method
Defining the skeleton of a blood ritual, leaving specific steps to sub-cults.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Template Method
ARCANUM SCHOOL: Evocation // Ritual Skeleton
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// ACTIONSCRIPT PATTERN //
package arcana.template {
public class BaseRitual {
// The Template Method
public final function conductRitual():void {
prepareCircle();
chantIncantation();
if (requiresSacrifice()) {
performSacrifice();
}
summonEntity();
}
private function prepareCircle():void {
trace("Drawing the pentagram with crushed chalk.");
}
protected function chantIncantation():void {
throw new Error("Must be overridden.");
}
protected function requiresSacrifice():Boolean {
return true; // Default
}
protected function performSacrifice():void {
throw new Error("Must be overridden if sacrifice is required.");
}
protected function summonEntity():void {
trace("The entity emerges from the void.");
}
}
public class FireDemonRitual extends BaseRitual {
override protected function chantIncantation():void {
trace("Chanting the words of the blazing inferno.");
}
override protected function performSacrifice():void {
trace("Tossing a burning coal into the center.");
}
}
}
Runic Tags:
#template-method
#actionscript
#flash
#rituals