From 92c5013d6fcc63ecf615d1e0e2acfe570175a6de Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Sat, 11 Dec 2010 08:50:43 +0100 Subject: Added Player::won and Player::won_value. --- server/player.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'server/player.cpp') diff --git a/server/player.cpp b/server/player.cpp index 27c4b73..bf3973c 100644 --- a/server/player.cpp +++ b/server/player.cpp @@ -14,6 +14,7 @@ void Player::round_start(int w) { riichi = false; score = 25000; wind = w; + won = 0; // Notify client of round start. client->round_start(); @@ -434,6 +435,8 @@ void Player::declare_ron(Tile tile) { } void Player::declare_tsumo() { + won = true; + List hands = Hand::get_breakdowns(hand); Sets hand = hands.front(); @@ -442,6 +445,8 @@ 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_value = score; } Score Player::calculate_score(const Sets& hand, bool tsumo) { -- cgit v1.2.3