summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/game.cpp27
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(&current_time) << " Round is over..." << std::endl;
-
- #endif
+ // Flere runder? round_start()
+ // Ferdig? game_end()
+ round_start();
}