⚙️ ALLOY RUNE DIFFICULTY: Adept Structural

The Decorator: Layering the Arcane Wards

Attach additional responsibilities to an object dynamically.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Decorator
ARCANUM SCHOOL: Abjuration // Ward-Layering
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// ALLOY PATTERN //
abstract sig Entity {
  power: lone Mana
}

sig BaseMage extends Entity {}

abstract sig WardLayer extends Entity {
  target: one Entity
}
{
  power = target.power
}

sig ShieldWard, StealthWard extends WardLayer {}

sig Mana {}

fact "Wards Cannot Wrap Themselves" {
  no w: WardLayer | w in w.^target
}

pred shield_up[w: ShieldWard] {
  some w.power
}

run shield_up for 4

The Decorator: Layering the Arcane Wards

By wrapping an Entity with a WardLayer, we seamlessly adopt its interface. Crucially, the decorator’s power relation maps exactly to its target’s power. Much like the Composite, we must defensively declare that a Ward cannot infinitely wrap itself, lest the analysis engine tear a hole in space-time.

Runic Tags: #structural #decorator #wards