summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/player.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/server/player.cpp b/server/player.cpp
index bf3973c..5b6fc83 100644
--- a/server/player.cpp
+++ b/server/player.cpp
@@ -431,11 +431,24 @@ void Player::make_kan_extend(int target) {
}
void Player::declare_ron(Tile tile) {
+ hand.push_back(tile);
+ // TODO: Mark winning tile.
+ hand.sort();
+
+ List<Sets> hands = Hand::get_breakdowns(hand);
+
+ Sets hand = hands.front();
+ hand.insert(hand.end(), open.begin(), open.end());
+ Score score = calculate_score(hand, false);
+
+ won = true;
+ won_value = score;
}
void Player::declare_tsumo() {
- won = true;
+ // TODO: Mark winning tile.
+ hand.sort();
List<Sets> hands = Hand::get_breakdowns(hand);
@@ -444,8 +457,7 @@ void Player::declare_tsumo() {
Score score = calculate_score(hand, true);
- std::cout << "Tsumo: " << score.han() << " han, " << score.fu << " fu: " << score.tsumo_east() << "/" << score.tsumo() << "." << std::endl;
-
+ won = true;
won_value = score;
}