source: network-game/common/Game.h@ 635ad9b

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

New GameSummary class for storing game results

  • Property mode set to 100644
File size: 1.3 KB
RevLine 
[f419b09]1#ifndef _GAME_H
2#define _GAME_H
3
4#include "Compiler.h"
5
6#include <string>
7#include <map>
8
[6319311]9#ifdef WINDOWS
10 #define WIN32_LEAN_AND_MEAN
11#endif
12
[f419b09]13#include "Player.h"
[b92e6a7]14#include "WorldMap.h"
[1d96513]15#include "Projectile.h"
[f419b09]16
17using namespace std;
18
19class Game {
20private:
[b92e6a7]21 unsigned int id;
[c044a36]22 string name;
[b92e6a7]23 map<unsigned int, Player*> players;
[1d96513]24 map<unsigned int, Projectile> projectiles;
[b92e6a7]25 WorldMap* worldMap;
[c9f6a1c]26 unsigned int blueScore;
27 unsigned int redScore;
[45734ff]28 unsigned int unusedProjectileId;
[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();
[c9f6a1c]38 unsigned int getBlueScore();
39 unsigned int getRedScore();
[b92e6a7]40 WorldMap* getMap();
[f419b09]41
[b92e6a7]42 void setId(unsigned int id);
[c9f6a1c]43 void setBlueScore(unsigned int score);
44 void setRedScore(unsigned int score);
[1d96513]45
[45734ff]46 map<unsigned int, Player*>& getPlayers();
[f419b09]47 bool addPlayer(Player* p);
[b92e6a7]48 bool removePlayer(unsigned int id);
[45734ff]49
50 map<unsigned int, Projectile>& getProjectiles();
51 bool addProjectile(Projectile p);
52 bool removeProjectile(unsigned int id);
53
[0129700]54 bool startPlayerMovement(unsigned int id, int x, int y);
[402cf86]55 bool processPlayerMovement(Player* p, FLOAT_POSITION oldPos);
[ce2bb87]56 int processFlagPickupRequest(Player* p);
[402cf86]57
[45734ff]58 void assignProjectileId(Projectile* p);
59 void updateUnusedProjectileId();
[f419b09]60};
61
62#endif
Note: See TracBrowser for help on using the repository browser.