summaryrefslogtreecommitdiff
path: root/server/score.cpp
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@jvnv.net>2010-12-25 12:54:59 +0100
committerVegard Storheil Eriksen <zyp@jvnv.net>2010-12-25 12:54:59 +0100
commitfae209a9e93400c3a2072befda9c820634cf9278 (patch)
tree2d69e2c75fff0e08468c168f773abbc939a2ff03 /server/score.cpp
parent94a1189d757f0269ac081ad2d750152e30564986 (diff)
Restructured repository.HEADmaster
Diffstat (limited to 'server/score.cpp')
-rw-r--r--server/score.cpp65
1 files changed, 0 insertions, 65 deletions
diff --git a/server/score.cpp b/server/score.cpp
deleted file mode 100644
index 7d0dc41..0000000
--- a/server/score.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-#include "score.h"
-
-inline int roundup(int value, int roundto) {
- return value % roundto ? value + roundto - value % roundto : value;
-}
-
-inline int max(int x, int y) {
- return x < y ? x : y;
-}
-
-Score::Score(int yaku_, int fu_, int dora_) : yaku(yaku_), fu(fu_), dora(dora_) {
-
-}
-
-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(fu_rounded() << (2 + han()), 2000);
-
- } else if(han() <= 5) {
- // Mangan.
- return 2000;
-
- } else if(han() <= 7) {
- // Haneman.
- return 3000;
-
- } else if(han() <= 10) {
- // Baiman.
- return 4000;
-
- } else if(han() <= 12) {
- // Sanbaiman.
- return 6000;
-
- } else {
- // Kazoe yakuman.
- return 8000;
-
- }
-}
-
-int Score::ron() {
- return roundup(base_points() * 4, 100);
-}
-
-int Score::ron_east() {
- return roundup(base_points() * 6, 100);
-}
-
-int Score::tsumo() {
- return roundup(base_points(), 100);
-}
-
-int Score::tsumo_east() {
- return roundup(base_points() * 2, 100);
-}