diff options
author | Atle Hellvik Havsø <atle@havso.net> | 2010-11-20 12:07:08 +0100 |
---|---|---|
committer | Atle Hellvik Havsø <atle@havso.net> | 2010-11-20 12:07:08 +0100 |
commit | b3e9ace28566e0572885b04924e2183c587369e7 (patch) | |
tree | 9ff4a1f2dc4f6cdf9aba93b8ad5974ad7507d1e9 /server/game.cpp | |
parent | 895afc162184f80b9c12e4a7042bd9e6680af30f (diff) |
Added a wall to Game and started handing out tiles to the players in the start of a game.
Signed-off-by: Atle Hellvik Havsø <atle@havso.net>
Diffstat (limited to 'server/game.cpp')
-rw-r--r-- | server/game.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/server/game.cpp b/server/game.cpp index 346251e..3f34d07 100644 --- a/server/game.cpp +++ b/server/game.cpp @@ -40,13 +40,32 @@ void Game::round_start() { players[3]->round_start(); // Sett opp runden + game_state = make_shared<State>(); + + // Simulates drawing 4, 4 ,4 for each player + for (int player_num = 0; player_num < 4; player_num++) { + for (int i = 0; i < 3; i++) { + for (int y = 0; y < 4; y++) { + game_state->players[player_num].hand.push_back(wall.take_one()); + } + } + } + + // Simulates the second part of drawing with only 1 tile + for (int player_num = 0; player_num < 4; player_num++) { + game_state->players[player_num].hand.push_back(wall.take_one()); + } + + // Gives an extra tile to the first player (east) + game_state->players[0].hand.push_back(wall.take_one()); + + round_update(); } void Game::round_update() { // Send RoundState, inkl. liste av mulige actions. - State::p game_state = make_shared<State>(); players[0]->round_state(game_state); players[1]->round_state(game_state); |