-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGameManager.h
More file actions
56 lines (46 loc) · 1.43 KB
/
GameManager.h
File metadata and controls
56 lines (46 loc) · 1.43 KB
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
49
50
51
52
53
54
#pragma once
#include "Container.h"
#include "GameCtrlIC.h"
#include "ScoreViewerGC.h"
#include "LivesViewer.h"
#include "ImageGC.h"
#include "GameStatusViewGC.h"
#include "FighterAsteroidCollision.h"
#include "BulletsAsteroidsCollision.h"
#include "FighterHoleCollision.h"
#include "BulletsHoleCollision.h"
#include "AsteroidHoleCollision.h"
class GameManager : public Container {
public:
GameManager(SDLGame* game);
virtual ~GameManager();
bool getRunning() { return running_; }
bool getGameOver() { return gameOver_; }
int getScore() { return score_; }
int getLives() { return lives_; }
int getWinner() { return winner_; }
void receive(const void* senderObj, const msg::Message& msg);
protected:
void setRunning(bool r) { running_ = r; }
void setGameOver(bool g) { gameOver_ = g; }
void setScore(int s) { score_ = s; }
void setLives(int l) { lives_ = l; }
void setWinner(int w) { winner_ = w; }
private:
static int const maxLives_ = 3;
bool running_;
bool gameOver_;
int score_;
int lives_;
int winner_; // 0=none, 1=asteroids, 2=fighter
// components of GameManager
GameCtrlIC gameCtrl_;
ScoreViewerGC scoreView_;
GameStatusViewGC gameStatusView_;
LivesViewer livesViewer_;
FighterAsteroidCollision fighterAsteroidCollision_;
BulletsAsteroidsCollision bulletsAsteroidsCollision_;
FighterHoleCollision fighterHoleCollision_;
BulletsHoleCollision bulletsHoleCollision_;
AsteroidHoleCollision asteroidHoleCollision_;
};