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

Last change on this file since 0065962 was 306758e, checked in by Dmitry Portnoy <dmp1488@…>, 10 years ago

Remove the serverSide argument from Game::addPlayer() since it's no longer useful

  • Property mode set to 100644
File size: 1.5 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"
[d05c484]16#include "MessageProcessor.h"
[f419b09]17
18using namespace std;
19
20class Game {
21private:
[b92e6a7]22 unsigned int id;
[c044a36]23 string name;
[b92e6a7]24 map<unsigned int, Player*> players;
[1d96513]25 map<unsigned int, Projectile> projectiles;
[b92e6a7]26 WorldMap* worldMap;
[c9f6a1c]27 unsigned int blueScore;
28 unsigned int redScore;
[45734ff]29 unsigned int unusedProjectileId;
[d05c484]30 MessageProcessor* msgProcessor;
[f419b09]31
32public:
33 Game();
[d05c484]34 Game(string name, string filepath, MessageProcessor* msgProcessor);
[f419b09]35
36 ~Game();
37
[ab8fd40]38 string getName();
[2ee386d]39 int getNumPlayers();
[c9f6a1c]40 unsigned int getBlueScore();
41 unsigned int getRedScore();
[b92e6a7]42 WorldMap* getMap();
[f419b09]43
[b92e6a7]44 void setId(unsigned int id);
[c9f6a1c]45 void setBlueScore(unsigned int score);
46 void setRedScore(unsigned int score);
[1d96513]47
[7f884ea]48 void addObjectToMap(ObjectType objectType, int x, int y);
[d05c484]49
[45734ff]50 map<unsigned int, Player*>& getPlayers();
[306758e]51 bool addPlayer(Player* p);
[b92e6a7]52 bool removePlayer(unsigned int id);
[45734ff]53
54 map<unsigned int, Projectile>& getProjectiles();
55 bool addProjectile(Projectile p);
56 bool removeProjectile(unsigned int id);
57
[0129700]58 bool startPlayerMovement(unsigned int id, int x, int y);
[402cf86]59 bool processPlayerMovement(Player* p, FLOAT_POSITION oldPos);
[ce2bb87]60 int processFlagPickupRequest(Player* p);
[d05c484]61 void dealDamageToPlayer(Player* p, int damage);
62
[45734ff]63 void assignProjectileId(Projectile* p);
64 void updateUnusedProjectileId();
[f419b09]65};
66
67#endif
Note: See TracBrowser for help on using the repository browser.