diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-06-20 12:40:18 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-06-20 12:40:18 (GMT) |
| commit | 2be9c925088c16beb144dd9932202416d00ff581 (patch) | |
| tree | 51f8ccbf2b0b051890c5f5d12fa28a67635c06c2 /src/game/GameController.cpp | |
| parent | 9769239af69695e9a7f8cf103a197695ecf691e0 (diff) | |
| download | powder-2be9c925088c16beb144dd9932202416d00ff581.zip powder-2be9c925088c16beb144dd9932202416d00ff581.tar.gz | |
OpenGL canvas for Windows, Notifications for main Game, Update checker in Client (+ other client triggered events)
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); +} + |
