summaryrefslogtreecommitdiff
path: root/server/hand.h
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@jvnv.net>2010-12-02 05:05:29 +0100
committerVegard Storheil Eriksen <zyp@jvnv.net>2010-12-02 05:05:29 +0100
commitdc291de04681fa78a949b9aa8eb5f8f29b0f9f0e (patch)
tree33ea596545c4f9cbc66787f15bdae8b94f038439 /server/hand.h
parentbe2a1877e3412095c3bfca3ad9ce36721e4c9fe9 (diff)
Changed Hand::eat_-functions to return a bool, so a failure can be distinguished from a depleted list of tiles.
Diffstat (limited to 'server/hand.h')
-rw-r--r--server/hand.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/server/hand.h b/server/hand.h
index e38a387..879bc8d 100644
--- a/server/hand.h
+++ b/server/hand.h
@@ -16,20 +16,20 @@ namespace Hand {
// Check if the tiles is matching the normal format but missing one.
bool basic_format_tenpai(const Tiles& tiles, bool pair_eaten = false, bool wait_eaten = false);
- // Eat a single tile (i.e. the tanki machi) from beginning of list and return rest.
- Tiles eat_tanki(Tiles tiles);
+ // Eat a single tile (i.e. the tanki machi) from beginning of list and return success flag.
+ bool eat_tanki(Tiles& tiles);
- // Eat two tiles waiting for a third to complete a chi (i.e. ryanmen, penchan or kanchan machi) if possible.
- Tiles eat_chi_wait(Tiles tiles);
+ // Eat two tiles waiting for a third to complete a chi (i.e. ryanmen, penchan or kanchan machi) if possible and return success flag.
+ bool eat_chi_wait(Tiles& tiles);
- // Eat a pair from beginning of list if possible and return rest, else return empty list.
- Tiles eat_pair(Tiles tiles);
+ // Eat a pair from beginning of list if possible and return success flag.
+ bool eat_pair(Tiles& tiles);
- // Eat a pon from beginning of list if possible and return rest, else return empty list.
- Tiles eat_pon(Tiles tiles);
+ // Eat a pon from beginning of list if possible and return success flag.
+ bool eat_pon(Tiles& tiles);
- // Eat a chi from beginning of list if possible and return rest, else return empty list.
- Tiles eat_chi(Tiles tiles);
+ // Eat a chi from beginning of list if possible and return success flag.
+ bool eat_chi(Tiles& tiles);
}
#endif