From fc4b974402a47f99ee08f5fe5520e2755c7b1dd7 Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Sat, 11 Dec 2010 07:17:28 +0100 Subject: Added Score::fu_rounded(). --- server/score.cpp | 6 +++++- server/score.h | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/server/score.cpp b/server/score.cpp index b4750c3..7d0dc41 100644 --- a/server/score.cpp +++ b/server/score.cpp @@ -16,10 +16,14 @@ int Score::han() { return yaku + dora; } +int Score::fu_rounded() { + return roundup(fu, 10); +} + int Score::base_points() { if(han() < 5) { // Normal hand. - return max(roundup(fu, 10) << (2 + han()), 2000); + return max(fu_rounded() << (2 + han()), 2000); } else if(han() <= 5) { // Mangan. diff --git a/server/score.h b/server/score.h index 677fde8..6dee09a 100644 --- a/server/score.h +++ b/server/score.h @@ -18,6 +18,9 @@ class Score { //! Calculate han. (yaku + dora) int han(); + //! Calculate fu rounded up to closest 10. + int fu_rounded(); + //! Calculate base points. int base_points(); -- cgit v1.2.3