🗼 EIFFEL CONTRACT DIFFICULTY: Apprentice Behavioral

The Strategy Grimoire

Dynamically swapping algorithms of destruction.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Strategy
ARCANUM SCHOOL: Evocation // Tactical
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// EIFFEL PATTERN //
deferred class
    COMBAT_STRATEGY

feature
    execute_tactics
        deferred
        end
end

class
    WAR_MAGE

feature
    tactic: COMBAT_STRATEGY

    set_tactic (t: COMBAT_STRATEGY)
        require
            valid_tactic: t /= Void
        do
            tactic := t
        ensure
            tactic_set: tactic = t
        end

    fight
        do
            tactic.execute_tactics
        end
end

By utilizing a Strategy, a War Mage can dynamically consult their Grimoire mid-battle, seamlessly switching from fiery bombardment to frost weaving.

Runic Tags: #behavioral #strategy #eiffel