source: network-game/common/Game.h@ ab8fd40

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
RevLine 
[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
19using namespace std;
20
21class Game {
22private:
[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
30public:
31 Game();
[233e736]32 Game(string name, string filepath);
[f419b09]33
34 ~Game();
35
[ab8fd40]36 string getName();
[2ee386d]37 int getNumPlayers();
[b92e6a7]38 map<unsigned int, Player*>& getPlayers();
39 int getBlueScore();
40 int getRedScore();
41 WorldMap* getMap();
[f419b09]42
[b92e6a7]43 void setId(unsigned int id);
[f419b09]44 bool addPlayer(Player* p);
[b92e6a7]45 bool removePlayer(unsigned int id);
46 void setBlueScore(int score);
47 void setRedScore(int score);
[f419b09]48};
49
50#endif
Note: See TracBrowser for help on using the repository browser.