diff options
Diffstat (limited to 'server')
-rw-r--r-- | server/game.cpp | 5 | ||||
-rw-r--r-- | server/game.h | 6 | ||||
-rw-r--r-- | server/player.cpp | 8 |
3 files changed, 16 insertions, 3 deletions
diff --git a/server/game.cpp b/server/game.cpp index 5a27eea..a41b90c 100644 --- a/server/game.cpp +++ b/server/game.cpp @@ -191,7 +191,7 @@ void Game::handle_action_draw(Action action) { } break; case Action::Tsumo: { - // Score calculation or something. + players[current_player].declare_tsumo(); round_end(); } break; @@ -251,7 +251,6 @@ void Game::handle_action_discard(Action action, int player) { // First ron. if(action.type == Action::Ron) { - // TODO: Handle simultanous ron. preceding_action = action; preceding_action_owner = player; break; @@ -313,7 +312,7 @@ void Game::handle_action_discard(Action action, int player) { } break; case Action::Ron: { - // Score calculation or something. + players[preceding_action_owner].declare_ron(players[current_player].claim()); round_end(); } break; diff --git a/server/game.h b/server/game.h index c8c5d6a..2a736de 100644 --- a/server/game.h +++ b/server/game.h @@ -108,6 +108,12 @@ class Game : public boost::enable_shared_from_this<Game> { //! Make extended kan. void make_kan_extend(int target); + + //! Declare win on discarded tile. + void declare_ron(Tile tile); + + //! Declare win on self-drawn tile. + void declare_tsumo(); }; Player players[4]; diff --git a/server/player.cpp b/server/player.cpp index 0c30608..67d35c9 100644 --- a/server/player.cpp +++ b/server/player.cpp @@ -421,3 +421,11 @@ void Game::Player::make_kan_extend(int target) { set.type = Set::Kan; } + +void Game::Player::declare_ron(Tile tile) { + +} + +void Game::Player::declare_tsumo() { + +} |