source:
network-game/common/Game.h@
03ba5e3
Last change on this file since 03ba5e3 was 233e736, checked in by , 11 years ago | |
---|---|
|
|
File size: 823 bytes |
Rev | Line | |
---|---|---|
[f419b09] | 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" | |
[b92e6a7] | 17 | #include "WorldMap.h" |
[f419b09] | 18 | |
19 | using namespace std; | |
20 | ||
21 | class Game { | |
22 | private: | |
[b92e6a7] | 23 | unsigned int id; |
[c044a36] | 24 | string name; |
[b92e6a7] | 25 | map<unsigned int, Player*> players; |
26 | WorldMap* worldMap; | |
27 | int blueScore; | |
28 | int redScore; | |
[f419b09] | 29 | |
30 | public: | |
31 | Game(); | |
[233e736] | 32 | Game(string name, string filepath); |
[f419b09] | 33 | |
34 | ~Game(); | |
35 | ||
[2ee386d] | 36 | int getNumPlayers(); |
[b92e6a7] | 37 | map<unsigned int, Player*>& getPlayers(); |
38 | int getBlueScore(); | |
39 | int getRedScore(); | |
40 | WorldMap* getMap(); | |
[f419b09] | 41 | |
[b92e6a7] | 42 | void setId(unsigned int id); |
[f419b09] | 43 | bool addPlayer(Player* p); |
[b92e6a7] | 44 | bool removePlayer(unsigned int id); |
45 | void setBlueScore(int score); | |
46 | void setRedScore(int score); | |
[f419b09] | 47 | }; |
48 | ||
49 | #endif |
Note:
See TracBrowser
for help on using the repository browser.