The Observer
Allowing familiars to react to shifts in magical leylines.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Observer
ARCANUM SCHOOL: Divination // Foresight
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// EXECUTABLE C++ PATTERN //
#include <vector>
class Observer { public: virtual void Update() = 0; };
class Leyline {
std::vector<Observer*> watchers;
public:
void Attach(Observer* o) { watchers.push_back(o); }
void Surge() { for(auto w : watchers) w->Update(); }
};
class Familiar : public Observer {
public: void Update() override {}
};
Runic Tags:
#behavioral
#observer
#cpp