summaryrefslogtreecommitdiff
path: root/src/game/GameModel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/GameModel.cpp')
-rw-r--r--src/game/GameModel.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/game/GameModel.cpp b/src/game/GameModel.cpp
index 2a9b69e..6a8f3d8 100644
--- a/src/game/GameModel.cpp
+++ b/src/game/GameModel.cpp
@@ -457,6 +457,19 @@ void GameModel::SetStamp(Save * newStamp)
notifyStampChanged();
}
+void GameModel::Log(string message)
+{
+ consoleLog.push_front(message);
+ if(consoleLog.size()>100)
+ consoleLog.pop_back();
+ notifyLogChanged(message);
+}
+
+deque<string> GameModel::GetLog()
+{
+ return consoleLog;
+}
+
void GameModel::notifyColourSelectorColourChanged()
{
for(int i = 0; i < observers.size(); i++)
@@ -576,3 +589,11 @@ void GameModel::notifyClipboardChanged()
observers[i]->NotifyClipboardChanged(this);
}
}
+
+void GameModel::notifyLogChanged(string entry)
+{
+ for(int i = 0; i < observers.size(); i++)
+ {
+ observers[i]->NotifyLogChanged(this, entry);
+ }
+}