From 4fe0de7a49b92b288b4ee577fa96450569b7b9cb Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Sat, 27 Nov 2010 09:48:20 +0100 Subject: Added dora. --- server/game.cpp | 8 ++++++-- 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 { 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(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(); -- cgit v1.2.3