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/GameModel.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/GameModel.cpp')
| -rw-r--r-- | src/game/GameModel.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/game/GameModel.cpp b/src/game/GameModel.cpp index 5c9344d..054a415 100644 --- a/src/game/GameModel.cpp +++ b/src/game/GameModel.cpp @@ -513,6 +513,39 @@ deque<string> GameModel::GetLog() return consoleLog; } +std::vector<Notification*> GameModel::GetNotifications() +{ + return notifications; +} + +void GameModel::AddNotification(Notification * notification) +{ + notifications.push_back(notification); + notifyNotificationsChanged(); +} + +void GameModel::RemoveNotification(Notification * notification) +{ + for(std::vector<Notification*>::iterator iter = notifications.begin(); iter != notifications.end(); ++iter) + { + if(*iter == notification) + { + notifications.erase(iter); + delete *iter; + break; + } + } + notifyNotificationsChanged(); +} + +void GameModel::notifyNotificationsChanged() +{ + for(std::vector<GameView*>::iterator iter = observers.begin(); iter != observers.end(); ++iter) + { + (*iter)->NotifyNotificationsChanged(this); + } +} + void GameModel::notifyColourSelectorColourChanged() { for(int i = 0; i < observers.size(); i++) |
