blob: 879bc8dafd21bb92498fec3a5f8e3579bd848955 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#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 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 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 and return success flag.
bool eat_chi_wait(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 success flag.
bool eat_pon(Tiles& tiles);
// Eat a chi from beginning of list if possible and return success flag.
bool eat_chi(Tiles& tiles);
}
#endif
|