The Decorator Rune
Dynamically attaching new properties to spells.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Decorator
ARCANUM SCHOOL: Transmutation // Enhancement
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// EIFFEL PATTERN //
deferred class
SPELL_COMPONENT
feature
mana_cost: INTEGER
deferred
end
end
deferred class
SPELL_DECORATOR
inherit
SPELL_COMPONENT
feature {NONE}
base_spell: SPELL_COMPONENT
feature
mana_cost: INTEGER
do
Result := base_spell.mana_cost + added_cost
end
added_cost: INTEGER
deferred
end
end
Decorators allow a spell to be amplified with metamagic runes, strictly adhering to the original spell’s interface while augmenting its behavior.
Runic Tags:
#structural
#decorator
#eiffel