The Flyweight Illusion
Sharing arcane states to render massive phantom armies.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Flyweight
ARCANUM SCHOOL: Illusion // Phantasm
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// EIFFEL PATTERN //
class
PHANTOM_FLYWEIGHT
feature -- State
intrinsic_aura: STRING
manifest (extrinsic_coords: TUPLE[x: INTEGER; y: INTEGER])
do
-- Render phantom at coords using intrinsic_aura
end
end
class
PHANTOM_FACTORY
feature -- Factory
get_phantom (aura: STRING): PHANTOM_FLYWEIGHT
-- Return cached phantom or create new
deferred
ensure
Result /= Void
end
end
By stripping extrinsic state from illusions, a master of the Flyweight pattern can project a legion using the mana of a single soldier.
Runic Tags:
#structural
#flyweight
#eiffel