Refactor the Pelican crossing exercise to use the Observer pattern: Pelican acts as Subject and each Pole observes it, replacing direct calls through the owned Pole pointer. Co-authored-by: Qwen 3.8 27B <qwen3.8_27b-q3_k_xl@lmstudio.local>
11 lines
121 B
C++
11 lines
121 B
C++
|
|
#ifndef OBSERVER_H
|
|
#define OBSERVER_H
|
|
|
|
class Observer {
|
|
public:
|
|
virtual void update() = 0;
|
|
};
|
|
|
|
#endif
|