Chain of Responsibility
Pass an incoming curse through a sequence of protective wards until one of them dispels it.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Chain of Responsibility
ARCANUM SCHOOL: Abjuration // Ward Layering
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// D PATTERN //
abstract class Ward {
protected Ward next;
void setNext(Ward w) { next = w; }
abstract void handleCurse(int intensity);
}
class MinorWard : Ward {
override void handleCurse(int intensity) {
if (intensity <= 10) { /* Dispelled */ }
else if (next !is null) next.handleCurse(intensity);
}
}
Layers of magical defense dynamically process or delegate threats.
Runic Tags:
#behavioral
#chain-of-responsibility
#dlang
#defense