diff options
Diffstat (limited to 'src/game/GameController.cpp')
| -rw-r--r-- | src/game/GameController.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/game/GameController.cpp b/src/game/GameController.cpp index 3031fb6..dfbd935 100644 --- a/src/game/GameController.cpp +++ b/src/game/GameController.cpp @@ -12,6 +12,7 @@ #include "dialogues/ErrorMessage.h" #include "GameModelException.h" #include "simulation/Air.h" +#include "Notification.h" using namespace std; @@ -132,6 +133,7 @@ GameController::GameController(): //commandInterface->AttachGameModel(gameModel); //sim = new Simulation(); + Client::Ref().AddListener(this); } GameController::~GameController() @@ -624,3 +626,26 @@ std::string GameController::ElementResolve(int type) return ""; } +void GameController::NotifyUpdateAvailable(Client * sender) +{ + class UpdateNotification : public Notification + { + GameController * c; + public: + UpdateNotification(GameController * c, std::string message) : c(c), Notification(message) {} + virtual ~UpdateNotification() {} + + virtual void Action() + { + c->RemoveNotification(this); + } + }; + + gameModel->AddNotification(new UpdateNotification(this, "An Update is available")); +} + +void GameController::RemoveNotification(Notification * notification) +{ + gameModel->RemoveNotification(notification); +} + |
