Last change
on this file since f419b09 was f419b09, checked in by dportnoy <dmp1488@…>, 11 years ago |
Added a Game class and new messages types for creating, joining, and leaving games
|
-
Property mode
set to
100644
|
File size:
487 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 |
|
---|
18 | using namespace std;
|
---|
19 |
|
---|
20 | class Game {
|
---|
21 | private:
|
---|
22 | int id;
|
---|
23 | string name
|
---|
24 | map<int, Player*> players;
|
---|
25 |
|
---|
26 | public:
|
---|
27 | Game();
|
---|
28 | Game(string name);
|
---|
29 |
|
---|
30 | ~Game();
|
---|
31 |
|
---|
32 | void setId(int id);
|
---|
33 |
|
---|
34 | bool addPlayer(Player* p);
|
---|
35 | bool removePlayer(int id);
|
---|
36 | };
|
---|
37 |
|
---|
38 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.