diff options
author | Vegard Storheil Eriksen <zyp@jvnv.net> | 2010-11-27 09:48:20 +0100 |
---|---|---|
committer | Vegard Storheil Eriksen <zyp@jvnv.net> | 2010-11-27 09:48:20 +0100 |
commit | 4fe0de7a49b92b288b4ee577fa96450569b7b9cb (patch) | |
tree | cc69a8d27a17be7bd5efaa4991cff9411db3e57b | |
parent | c9a12a47d6cbcaa3b6f4357083c92380e9b3d36f (diff) |
Added dora.
-rw-r--r-- | server/game.cpp | 8 | ||||
-rw-r--r-- | server/game.h | 6 |
2 files changed, 10 insertions, 4 deletions
diff --git a/server/game.cpp b/server/game.cpp index 76ee99d..75b369d 100644 --- a/server/game.cpp +++ b/server/game.cpp @@ -63,6 +63,10 @@ void Game::round_start() { // Build a new wall. wall.build(); + // Clear previous dora and draw a new. + dora.clear(); + dora.push_back(wall.take_one()); + // Notify players of round start. // TODO: Tell them where wall is broken. players[0].round_start(); @@ -111,7 +115,7 @@ void Game::round_update_draw() { a = possible_actions; } - players[player].client->round_state(state[0], state[1], state[2], state[3], Tiles(), a); + players[player].client->round_state(state[0], state[1], state[2], state[3], dora, a); } while(++player); // Await action from client. @@ -140,7 +144,7 @@ void Game::round_update_discard() { } } - players[player].client->round_state(state[0], state[1], state[2], state[3], Tiles(), a); + players[player].client->round_state(state[0], state[1], state[2], state[3], dora, a); } while(++player); preceding_action = Action::Pass; diff --git a/server/game.h b/server/game.h index a39b44a..5d32a77 100644 --- a/server/game.h +++ b/server/game.h @@ -86,6 +86,10 @@ class Game : public boost::enable_shared_from_this<Game> { Player players[4]; + Wall wall; + + Tiles dora; + PlayerNum current_player; int awaiting_players; @@ -95,8 +99,6 @@ class Game : public boost::enable_shared_from_this<Game> { Game(Client::p player_1, Client::p player_2, Client::p player_3, Client::p player_4); - Wall wall; - //! Handle Ready message from player. void handle_ready(); |