diff options
Diffstat (limited to 'server/game.cpp')
-rw-r--r-- | server/game.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/server/game.cpp b/server/game.cpp index c189776..1806e25 100644 --- a/server/game.cpp +++ b/server/game.cpp @@ -44,20 +44,20 @@ void Game::round_start() { players[3]->id = 3; // Sett opp runden sin state - game_state = make_shared<State>(); + //game_state = make_shared<State>(); // Simulates drawing 4, 4 ,4 for each player for (int i = 0; i < 3; i++) { for (int player_num = 0; player_num < 4; player_num++) { for (int y = 0; y < 4; y++) { - game_state->players[player_num].hand.push_back(wall.take_one()); + 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()); + game_state.players[player_num].hand.push_back(wall.take_one()); } current_player = 0; @@ -76,13 +76,13 @@ void Game::round_update() { round_end(); } - game_state->players[current_player].hand.push_back(wall.take_one()); + game_state.players[current_player].hand.push_back(wall.take_one()); Action discard_action; discard_action.type = Action::Discard; discard_action.player = current_player; - game_state->possible_actions.push_back(discard_action); + game_state.possible_actions.push_back(discard_action); // TODO // Add code for calculation of possible riichi, tsumo, kan and draw @@ -130,8 +130,8 @@ void Game::handle_action(Action action) { } break; case Action::Discard: { - game_state->players[current_player].pond.push_back(game_state->players[current_player].hand[action.target]); - game_state->players[current_player].hand.erase(game_state->players[current_player].hand.begin() + action.target); + game_state.players[current_player].pond.push_back(game_state.players[current_player].hand[action.target]); + game_state.players[current_player].hand.erase(game_state.players[current_player].hand.begin() + action.target); } break; case Action::Riichi: { |