summaryrefslogtreecommitdiff
path: root/src/game/GameModel.h
blob: 753e19d1bc0a7ef368c50b3dc535b7bffe2dacda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef GAMEMODEL_H
#define GAMEMODEL_H

#include <vector>
#include "search/Save.h"
#include "simulation/Simulation.h"
#include "Renderer.h"
#include "GameView.h"
#include "Brush.h"

using namespace std;

class GameView;
class Simulation;
class Renderer;

class GameModel
{
private:
	vector<GameView*> observers;
	Brush * currentBrush;
	Save * currentSave;
	Simulation * sim;
	Renderer * ren;
	int activeElement;
	void notifyRendererChanged();
	void notifySimulationChanged();
	void notifyPausedChanged();
	void notifySaveChanged();
	void notifyBrushChanged();
public:
	GameModel();
	~GameModel();
	Save * GetSave();
	Brush * GetBrush();
	void SetSave(Save * newSave);
	void AddObserver(GameView * observer);
	int GetActiveElement();
	void SetActiveElement(int element);
	bool GetPaused();
	void SetPaused(bool pauseState);
	void ClearSimulation();

	Simulation * GetSimulation();
	Renderer * GetRenderer();
};

#endif // GAMEMODEL_H