Line | |
---|
1 | #ifndef _GAME_H
|
---|
2 | #define _GAME_H
|
---|
3 |
|
---|
4 | #include "Compiler.h"
|
---|
5 |
|
---|
6 | #include <string>
|
---|
7 | #include <map>
|
---|
8 |
|
---|
9 | #ifdef WINDOWS
|
---|
10 | #define WIN32_LEAN_AND_MEAN
|
---|
11 | #endif
|
---|
12 |
|
---|
13 | #include "Player.h"
|
---|
14 | #include "WorldMap.h"
|
---|
15 | #include "Projectile.h"
|
---|
16 |
|
---|
17 | using namespace std;
|
---|
18 |
|
---|
19 | class Game {
|
---|
20 | private:
|
---|
21 | unsigned int id;
|
---|
22 | string name;
|
---|
23 | map<unsigned int, Player*> players;
|
---|
24 | map<unsigned int, Projectile> projectiles;
|
---|
25 | WorldMap* worldMap;
|
---|
26 | unsigned int blueScore;
|
---|
27 | unsigned int redScore;
|
---|
28 | unsigned int unusedProjectileId;
|
---|
29 |
|
---|
30 | public:
|
---|
31 | Game();
|
---|
32 | Game(string name, string filepath);
|
---|
33 |
|
---|
34 | ~Game();
|
---|
35 |
|
---|
36 | string getName();
|
---|
37 | int getNumPlayers();
|
---|
38 | unsigned int getBlueScore();
|
---|
39 | unsigned int getRedScore();
|
---|
40 | WorldMap* getMap();
|
---|
41 |
|
---|
42 | void setId(unsigned int id);
|
---|
43 | void setBlueScore(unsigned int score);
|
---|
44 | void setRedScore(unsigned int score);
|
---|
45 |
|
---|
46 | map<unsigned int, Player*>& getPlayers();
|
---|
47 | bool addPlayer(Player* p);
|
---|
48 | bool removePlayer(unsigned int id);
|
---|
49 |
|
---|
50 | map<unsigned int, Projectile>& getProjectiles();
|
---|
51 | bool addProjectile(Projectile p);
|
---|
52 | bool removeProjectile(unsigned int id);
|
---|
53 |
|
---|
54 | bool startPlayerMovement(unsigned int id, int x, int y);
|
---|
55 | bool processPlayerMovement(Player* p, FLOAT_POSITION oldPos);
|
---|
56 | int processFlagPickupRequest(Player* p);
|
---|
57 |
|
---|
58 | void assignProjectileId(Projectile* p);
|
---|
59 | void updateUnusedProjectileId();
|
---|
60 | };
|
---|
61 |
|
---|
62 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.