Libsaki
Core library of Pancake Mahjong
explain.h
1 #ifndef SAKI_EXPLAIN_H
2 #define SAKI_EXPLAIN_H
3 
4 #include "hand.h"
5 
6 #include <array>
7 #include <vector>
8 
9 
10 
11 namespace saki
12 {
13 
14 
15 
27 class Explain4
28 {
29 public:
30  explicit Explain4(const std::vector<T34> &heads, Wait wait, T34 pair,
31  int o3Ct, int c3Ct, int o4Ct, int c4Ct);
32 
33  static std::vector<Explain4> make(const TileCount &count, const util::Stactor<M37, 4> &barks,
34  T34 pick, bool ron);
35 
36  const std::array<T34, 4> &heads() const;
37  Wait wait() const;
38  T34 pair() const;
39 
40  using Iter = std::array<T34, 4>::const_iterator;
41 
42  Iter sb() const;
43  Iter se() const;
44  Iter o3b() const;
45  Iter o3e() const;
46  Iter c3b() const;
47  Iter c3e() const;
48  Iter o4b() const;
49  Iter o4e() const;
50  Iter c4b() const;
51  Iter c4e() const;
52  Iter x34b() const;
53  Iter x34e() const;
54 
55  int numS() const;
56  int numX34() const;
57  int numO3() const;
58  int numC3() const;
59  int numO4() const;
60  int numC4() const;
61 
62 private:
63  static void mapWait(std::vector<Explain4> &res, T34 pick, bool ron, T34 pair,
64  const std::vector<T34> &sHeads,
65  const std::vector<T34> &o3Heads, const std::vector<T34> &c3Heads,
66  const std::vector<T34> &o4Heads, const std::vector<T34> &c4Heads);
67 
68 private:
69  std::array<T34, 4> mHeads;
70  Wait mWait;
71  T34 mPair;
72  int mO3b;
73  int mC3b;
74  int mO4b;
75  int mC4b;
76 };
77 
78 
79 
80 } // namespace saki
81 
82 
83 
84 #endif // SAKI_EXPLAIN_H
Definition: tile.h:25
Definition: tile_count.h:17
Definition: ai.cpp:18
Parsed 4-meld complete hand.
Definition: explain.h:27
Stactor = statically allocated vector.
Definition: stactor.h:247