source: network-game/common/Game.h@ 233e736

Last change on this file since 233e736 was 233e736, checked in by Dmitry Portnoy <dportnoy@…>, 11 years ago

Fixed a client-side map loading bug

  • Property mode set to 100644
File size: 823 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
19using namespace std;
20
21class Game {
22private:
23 unsigned int id;
24 string name;
25 map<unsigned int, Player*> players;
26 WorldMap* worldMap;
27 int blueScore;
28 int redScore;
29
30public:
31 Game();
32 Game(string name, string filepath);
33
34 ~Game();
35
36 int getNumPlayers();
37 map<unsigned int, Player*>& getPlayers();
38 int getBlueScore();
39 int getRedScore();
40 WorldMap* getMap();
41
42 void setId(unsigned int id);
43 bool addPlayer(Player* p);
44 bool removePlayer(unsigned int id);
45 void setBlueScore(int score);
46 void setRedScore(int score);
47};
48
49#endif
Note: See TracBrowser for help on using the repository browser.