2 #ifndef SERVER__GAMEENGINE__H
3 #define SERVER__GAMEENGINE__H
19 class questionAndAnswer;
23 #include "GameState.hpp"
24 #include "shared/Map.hpp"
25 #include "shared/Binary.hpp"
26 #include "shared/Player.hpp"
27 #include "shared/RuleArgsStruct.hpp"
28 #include "shared/questionAndAnswer.hpp"
29 #include "shared/Rules.hpp"
40 std::shared_ptr<shared::Map> gameMap;
43 std::vector<std::shared_ptr<shared::Player>> players;
47 GameEngine (std::vector<std::shared_ptr<GameEngine>> & games, std::shared_ptr<shared::Player> player);
48 void* handleConnect ();
55 static std::string generateRandomId (
const std::vector<std::shared_ptr<GameEngine>> & games);
57 std::vector<std::shared_ptr<shared::Player>>& getPlayers ();
58 bool addPlayer (std::shared_ptr<shared::Player> player);
59 void processClientRequest (std::string requestString, std::shared_ptr<shared::Player> player);
60 static std::vector<std::string> splitString (std::string str,
char delimiter);
61 std::string askClient (
int playerId);
62 void askClient (std::shared_ptr<shared::Player> player);
63 void sendToEveryone (std::string message,
bool isBinary =
false);
65 bool setMapParam (std::string& param, std::string& value);
class GameEngine -
Definition: GameEngine.hpp:34
void runGame()
This function help to load the map and start the game.
Definition: GameEngine.cpp:60
std::string getTime()
This function return the time under a string format For example, if the time is 1:34pm,...
Definition: GameEngine.cpp:242
void playTurn()
Function allowing a player to play his turn, composed of several action.
void * endOfRoundActions()
Function handling all the actions at the end of a round (ex: check for end of game,...
class Binary -
Definition: Binary.hpp:18
class RuleArgsStruct -
Definition: RuleArgsStruct.hpp:25