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.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/game/GameModel.cpp b/src/game/GameModel.cpp
index 3271f3a..8062c64 100644
--- a/src/game/GameModel.cpp
+++ b/src/game/GameModel.cpp
@@ -11,7 +11,8 @@ GameModel::GameModel():
sim(NULL),
ren(NULL),
currentSave(NULL),
- currentBrush(new Brush(ui::Point(4, 4)))
+ currentBrush(new Brush(ui::Point(4, 4))),
+ currentUser(0, "")
{
sim = new Simulation();
ren = new Renderer(ui::Engine::Ref().g, sim);
@@ -132,6 +133,17 @@ Renderer * GameModel::GetRenderer()
return ren;
}
+User GameModel::GetUser()
+{
+ return currentUser;
+}
+
+void GameModel::SetUser(User user)
+{
+ currentUser = user;
+ notifyUserChanged();
+}
+
void GameModel::SetPaused(bool pauseState)
{
sim->sys_pause = pauseState?1:0;
@@ -211,3 +223,11 @@ void GameModel::notifyActiveToolChanged()
observers[i]->NotifyActiveToolChanged(this);
}
}
+
+void GameModel::notifyUserChanged()
+{
+ for(int i = 0; i < observers.size(); i++)
+ {
+ observers[i]->NotifyUserChanged(this);
+ }
+}