source: network-game/common/Game.h@ 0693e25

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

The client draws the map and players in individual games

  • Property mode set to 100644
File size: 948 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
[0693e25]16#include <allegro5/allegro_font.h>
17
[f419b09]18#include "Player.h"
[b92e6a7]19#include "WorldMap.h"
[f419b09]20
21using namespace std;
22
23class Game {
24private:
[b92e6a7]25 unsigned int id;
[c044a36]26 string name;
[b92e6a7]27 map<unsigned int, Player*> players;
28 WorldMap* worldMap;
29 int blueScore;
30 int redScore;
[f419b09]31
32public:
33 Game();
[233e736]34 Game(string name, string filepath);
[f419b09]35
36 ~Game();
37
[ab8fd40]38 string getName();
[2ee386d]39 int getNumPlayers();
[b92e6a7]40 map<unsigned int, Player*>& getPlayers();
41 int getBlueScore();
42 int getRedScore();
43 WorldMap* getMap();
[f419b09]44
[b92e6a7]45 void setId(unsigned int id);
[f419b09]46 bool addPlayer(Player* p);
[b92e6a7]47 bool removePlayer(unsigned int id);
48 void setBlueScore(int score);
49 void setRedScore(int score);
[0693e25]50
51 void drawPlayers(ALLEGRO_FONT* font, unsigned int curPlayerId);
[f419b09]52};
53
54#endif
Note: See TracBrowser for help on using the repository browser.