source: network-game/common/Game.h@ 1d96513

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

Game class includes projectile list

  • Property mode set to 100644
File size: 1.1 KB
Line 
1#ifndef _GAME_H
2#define _GAME_H
3
4#include "Compiler.h"
5
6#include <string>
7#include <map>
8
9#ifdef WINDOWS
10 #define WIN32_LEAN_AND_MEAN
11#endif
12
13#include "Player.h"
14#include "WorldMap.h"
15#include "Projectile.h"
16
17using namespace std;
18
19class Game {
20private:
21 unsigned int id;
22 string name;
23 map<unsigned int, Player*> players;
24 map<unsigned int, Projectile> projectiles;
25 WorldMap* worldMap;
26 int blueScore;
27 int redScore;
28
29public:
30 Game();
31 Game(string name, string filepath);
32
33 ~Game();
34
35 string getName();
36 int getNumPlayers();
37 map<unsigned int, Player*>& getPlayers();
38 map<unsigned int, Projectile>& getProjectiles();
39 int getBlueScore();
40 int getRedScore();
41 WorldMap* getMap();
42
43 void setId(unsigned int id);
44 void setBlueScore(int score);
45 void setRedScore(int score);
46
47 bool addPlayer(Player* p);
48 bool removePlayer(unsigned int id);
49 bool startPlayerMovement(unsigned int id, int x, int y);
50 bool processPlayerMovement(Player* p, FLOAT_POSITION oldPos);
51 int processFlagPickupRequest(Player* p);
52
53 bool addProjectile(Projectile p);
54 bool removeProjectile(unsigned int id);
55};
56
57#endif
Note: See TracBrowser for help on using the repository browser.