The Bridge of Ethereal Realms
Decouple an arcane abstraction from its implementation using predicate matching.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Bridge
ARCANUM SCHOOL: Conjuration // Planarmancy
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// PROLOG PATTERN //
% Implementor: The Realm
realm_effect(abyssal, entity(Demon), 'is shrouded in darkness').
realm_effect(celestial, entity(Angel), 'radiates blinding light').
% Abstraction: The Summoning Ritual
% Decoupled from the specific realm effects
ritual_summon(Realm, EntityName) :-
Entity = entity(EntityName),
realm_effect(Realm, Entity, Effect),
format('The ~w ~w as it enters the material plane.', [EntityName, Effect]).
% ?- ritual_summon(celestial, seraph).
% "The seraph radiates blinding light as it enters the material plane."
Runic Tags:
#bridge
#structural
#prolog
#decoupling
#planes