/* View class module stores the different displays of BiquadrisDisplay (TextDisplay and GraphicDisplay) encapsulates their functions */ #ifndef _VIEW_H_ #define _VIEW_H_ #include "observer.h" #include <memory> #include <vector> #include "display.h" #include "subscriptions.h" class BiquadrisDisplay; class Cell; class Scoreboard; class BiquadrisModel; class Board; class View : public Observer { std::vector<std::unique_ptr<BiquadrisDisplay>> displays; void updateByModel(BiquadrisModel *m); void updateByScoreboard(Scoreboard *sb); void updateByBoard(Board *b); void updateByCell(Cell *c); void updateHint(Board *b); public: View(bool graphic, int width, int height); ~View(); std::vector<SubscriptionType> subType() override; void notify(Subject *whoNotified, SubscriptionType t) override; friend std::ostream &operator<<(std::ostream &out, const View &v); }; #endif