diff options
Diffstat (limited to 'server')
-rw-r--r-- | server/score.cpp | 6 | ||||
-rw-r--r-- | server/score.h | 3 |
2 files changed, 8 insertions, 1 deletions
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(); |