diff options
author | Vegard Storheil Eriksen <zyp@jvnv.net> | 2010-12-01 15:23:25 +0100 |
---|---|---|
committer | Vegard Storheil Eriksen <zyp@jvnv.net> | 2010-12-01 15:23:25 +0100 |
commit | 44e1ff4182f6983f2f363f12ff12970749ae8b46 (patch) | |
tree | 5841299849911d5c5cd7eefec1feb8d0161a7d5c /server/hand.h | |
parent | 1a8477e06eed82f2ea800e6928dee7e4c22ad178 (diff) |
Move hand calculations to a new file.
Diffstat (limited to 'server/hand.h')
-rw-r--r-- | server/hand.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/server/hand.h b/server/hand.h new file mode 100644 index 0000000..46ae40a --- /dev/null +++ b/server/hand.h @@ -0,0 +1,23 @@ +#ifndef HAND_H +#define HAND_H + +#include "../common/tile.h" + +namespace Hand { + //! Check if the tiles constitute a complete hand. Also valid for the concealed part of an open hand. + bool agari(const Tiles& tiles); + + // Check if the tiles is matching the normal format of one pair and rest triplets. + bool basic_format(const Tiles& tiles, bool pair_eaten = false); + + // Eat a pair from beginning of list if possible and return rest, else return empty list. + Tiles 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 chi from beginning of list if possible and return rest, else return empty list. + Tiles eat_chi(Tiles tiles); +} + +#endif |