diff options
Diffstat (limited to 'server/hand.h')
-rw-r--r-- | server/hand.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/server/hand.h b/server/hand.h index 46ae40a..e38a387 100644 --- a/server/hand.h +++ b/server/hand.h @@ -7,9 +7,21 @@ 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 miss only one from constituting a complete hand. Also valid for the concealed part of an open hand. + bool tenpai(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); + // 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 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 a pair from beginning of list if possible and return rest, else return empty list. Tiles eat_pair(Tiles tiles); |