|
Eile Mit Weile
|
Extra functionality for server-side GameState. More...
#include <ServerGameState.hpp>
Additional Inherited Members | |
Static Public Member Functions inherited from GameState | |
| static GameState * | FromJson (const rapidjson::Value &json) |
Protected Member Functions inherited from UniqueSerializable | |
| UniqueSerializable () | |
| UniqueSerializable (std::string id) | |
Protected Attributes inherited from GameState | |
| Board * | _board |
| std::vector< Player * > | _players |
| SerializableValue< bool > * | _is_started |
| SerializableValue< bool > * | _is_finished |
| SerializableValue< int > * | _current_player_idx |
| SerializableValue< int > * | _play_direction |
Protected Attributes inherited from UniqueSerializable | |
| std::string | id |
Static Protected Attributes inherited from GameState | |
| static const int | _max_nof_players = 4 |
| static const int | _min_nof_players = 2 |
Extra functionality for server-side GameState.
Add a player to the game if it isn't full, hasn't already started, the player isn't already in the game and the player name isn't already taken. Returns false if it fails, with an error message in err.
| bool ServerGameState::MoveFigure | ( | Player * | player, |
| unsigned | figure_id, | ||
| unsigned | space_id, | ||
| std::string & | err | ||
| ) |
Move a figure if the player is allowed to do so. Checks if
Remove a player from the game if the player can be found in the game. Returns false if it fails, with an error message in err.
| bool ServerGameState::StartGame | ( | std::string & | err | ) |
Start the game if enough players are in the game and hasn't already started. Also randomly picks a startig Player. Returns false if it fails, with an error message in err.
| bool ServerGameState::UpdateCurrentPlayer | ( | std::string & | err | ) |