-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathGameManager.h
46 lines (41 loc) · 1.2 KB
/
GameManager.h
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
#pragma once
#include "Types.h"
#include "Renderer.h"
#include "GameEntityCreator.h"
#include "IObserver.h"
#include "SceneManager.h"
#include "EntityCoordinator.h"
// this class stores data specific to the game itself, and not as relevant to the underlying game engine
class GameManager : public IObserver, public ISubject
{
private:
GameManager();
EntityID player;
EntityID playerRespawner;
int gameFrameCount = 0;
bool gamePaused = false;
std::string curScene;
SceneManager* sceneManager;
bool isGameOver;
void createGameOverOverlay(int playerScore, vector<string> dates, vector<string> scores);
void replay();
public:
bool hasActiveStar = false;
// config files
static std::string menuScene;
static std::string gameScene;
static std::string prefabs;
static GameManager& getInstance();
void identifyPlayerAndPlayerSpawner();
EntityID PlayerRespawnerID();
void countGameFrame();
int getCurrGameFrame();
bool GameIsPaused();
void PauseGame();
void UnpauseGame();
// game states
std::string getCurScene();
void loadScene(std::string scene);
void handleGameOver();
void Receive(Event e, void* args) override;
};