summaryrefslogtreecommitdiff
path: root/server/game.h
diff options
context:
space:
mode:
Diffstat (limited to 'server/game.h')
-rw-r--r--server/game.h31
1 files changed, 24 insertions, 7 deletions
diff --git a/server/game.h b/server/game.h
index 9c2513e..3eaac77 100644
--- a/server/game.h
+++ b/server/game.h
@@ -11,8 +11,6 @@
#include "../common/action.h"
#include "../common/state.h"
-#include "gamevariant.h"
-#include "standard.h"
class Game : public boost::enable_shared_from_this<Game> {
public:
@@ -23,7 +21,6 @@ class Game : public boost::enable_shared_from_this<Game> {
~Game();
private:
- std::vector<Client::p> players;
class Player {
public:
Client::p client;
@@ -77,11 +74,18 @@ class Game : public boost::enable_shared_from_this<Game> {
};
- int waiting_players;
+ Player players[4];
+
+ int current_player;
+
+ int awaiting_players;
+
+ Action preceding_action;
+ int preceding_action_owner;
Game(Client::p player_1, Client::p player_2, Client::p player_3, Client::p player_4);
- GameVariant *ruleset;
+ Wall wall;
//! Handle Ready message from player.
void handle_ready();
@@ -89,9 +93,22 @@ class Game : public boost::enable_shared_from_this<Game> {
//! Start the game.
void start();
+ //! Start a new round.
void round_start();
- void round_update();
- void handle_action(Action action);
+
+ //! Send update after a tile is drawn.
+ void round_update_draw();
+
+ //! Send update after a tile is discarded.
+ void round_update_discard();
+
+ //! Handle action after draw.
+ void handle_action_draw(Action action);
+
+ //! Handle actions after discard.
+ void handle_action_discard(Action action, int player);
+
+ //! End the game.
void round_end();
};