diff options
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); |