Last change
on this file since ab8fd40 was ab8fd40, checked in by dportnoy <dmp1488@…>, 11 years ago |
The server can process LEAVE_GAME messages
|
-
Property mode
set to
100644
|
File size:
844 bytes
|
Line | |
---|
1 | #ifndef _GAME_H
|
---|
2 | #define _GAME_H
|
---|
3 |
|
---|
4 | #include "Compiler.h"
|
---|
5 |
|
---|
6 | #if defined WINDOWS
|
---|
7 | #include <winsock2.h>
|
---|
8 | #include <WS2tcpip.h>
|
---|
9 | #elif defined LINUX
|
---|
10 | #include <netinet/in.h>
|
---|
11 | #endif
|
---|
12 |
|
---|
13 | #include <string>
|
---|
14 | #include <map>
|
---|
15 |
|
---|
16 | #include "Player.h"
|
---|
17 | #include "WorldMap.h"
|
---|
18 |
|
---|
19 | using namespace std;
|
---|
20 |
|
---|
21 | class Game {
|
---|
22 | private:
|
---|
23 | unsigned int id;
|
---|
24 | string name;
|
---|
25 | map<unsigned int, Player*> players;
|
---|
26 | WorldMap* worldMap;
|
---|
27 | int blueScore;
|
---|
28 | int redScore;
|
---|
29 |
|
---|
30 | public:
|
---|
31 | Game();
|
---|
32 | Game(string name, string filepath);
|
---|
33 |
|
---|
34 | ~Game();
|
---|
35 |
|
---|
36 | string getName();
|
---|
37 | int getNumPlayers();
|
---|
38 | map<unsigned int, Player*>& getPlayers();
|
---|
39 | int getBlueScore();
|
---|
40 | int getRedScore();
|
---|
41 | WorldMap* getMap();
|
---|
42 |
|
---|
43 | void setId(unsigned int id);
|
---|
44 | bool addPlayer(Player* p);
|
---|
45 | bool removePlayer(unsigned int id);
|
---|
46 | void setBlueScore(int score);
|
---|
47 | void setRedScore(int score);
|
---|
48 | };
|
---|
49 |
|
---|
50 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.