source: network-game/common/Game.h@ 2ee386d

Last change on this file since 2ee386d was 2ee386d, checked in by dportnoy <dmp1488@…>, 11 years ago

Clients store the total number of players in each game

  • Property mode set to 100644
File size: 551 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
18using namespace std;
19
20class Game {
21private:
22 int id;
23 string name;
24 map<int, Player*> players;
25
26public:
27 Game();
28 Game(string name);
29
30 ~Game();
31
32 int getNumPlayers();
33
34 void setId(int id);
35 void setNumPlayers(int numPlayers);
36 bool addPlayer(Player* p);
37 bool removePlayer(int id);
38};
39
40#endif
Note: See TracBrowser for help on using the repository browser.