diff options
author | Vegard Storheil Eriksen <zyp@jvnv.net> | 2010-11-28 07:12:56 +0100 |
---|---|---|
committer | Vegard Storheil Eriksen <zyp@jvnv.net> | 2010-11-28 07:12:56 +0100 |
commit | 3e36d13d93775f8ce35e56fc796a01b1f936250a (patch) | |
tree | 6b77016a80062e40e581ea30037b4d51ea1f2b05 /server | |
parent | 91dbb6cd4564a197ec1ae925daa593eeb3629565 (diff) |
Handle Ron and Tsumo actions, start a new round after one is over.
Diffstat (limited to 'server')
-rw-r--r-- | server/game.cpp | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/server/game.cpp b/server/game.cpp index 9a56b47..aa28263 100644 --- a/server/game.cpp +++ b/server/game.cpp @@ -69,6 +69,8 @@ void Game::start() { } void Game::round_start() { + std::cout << "Starting a new round." << std::endl; + // Build a new wall. wall.build(); @@ -181,9 +183,13 @@ void Game::handle_action_draw(Action action) { round_update_discard(); } break; + case Action::Tsumo: { + // Score calculation or something. + round_end(); + } break; + case Action::Riichi: case Action::Kan: - case Action::Tsumo: case Action::Draw: // Not implemented yet. @@ -268,10 +274,10 @@ void Game::handle_action_discard(Action action, int player) { round_update_draw(); } break; - case Action::Ron: - // Not implemented yet. - std::cout << "Hei, morn, god dag!" << std::endl; - break; + case Action::Ron: { + // Score calculation or something. + round_end(); + } break; // Will never occur on discard: case Action::Discard: @@ -283,17 +289,12 @@ void Game::handle_action_discard(Action action, int player) { } void Game::round_end() { - // Flere runder? round_start() - // Ferdig? game_end() players[0].client->round_end(); players[1].client->round_end(); players[2].client->round_end(); players[3].client->round_end(); - #ifdef DEBUG - - time_t current_time = std::time(0); - std::cout << std::ctime(¤t_time) << " Round is over..." << std::endl; - - #endif + // Flere runder? round_start() + // Ferdig? game_end() + round_start(); } |