1 #ifndef SAKI_TILECOUNT_H 2 #define SAKI_TILECOUNT_H 7 #include <initializer_list> 20 enum AkadoraCount { AKADORA0, AKADORA3, AKADORA4 };
26 std::vector<T34> triplets;
27 std::vector<T34> sequences;
31 explicit TileCount(AkadoraCount fillMode);
32 explicit TileCount(std::initializer_list<T37> t37s);
38 int ct(
const T37 &t)
const;
45 int ct(
const V &ts)
const 47 auto aux = [
this](
int s,
T34 t) {
return s + ct(t); };
48 return std::accumulate(ts.begin(), ts.end(), 0, aux);
51 bool has(Suit s)
const;
57 void inc(
const T37 &t,
int delta);
62 int step(
int barkCt)
const;
63 int stepGb(
int barkCt)
const;
64 int step4(
int barkCt)
const;
69 bool hasEffA(
int barkCt,
T34 t)
const;
70 bool hasEffA4(
int barkCt,
T34 t)
const;
71 bool hasEffA7(
T34 t)
const;
72 bool hasEffA13(
T34 t)
const;
79 Parseds parse(
int barkCt)
const;
84 std::vector<Explain4Closed> explain4(
T34 pick)
const;
85 bool onlyInTriplet(
T34 pick,
int barkCt)
const;
87 int sum(
const std::vector<T34> &ts)
const;
90 template<
typename Ret,
typename... Params,
typename... Args>
91 Ret peekDraw(
T34 t, Ret (
TileCount::*f) (Params...)
const, Args && ... args)
const 93 return peekDelta(t, 1, f, std::forward<Args>(args) ...);
96 template<
typename Ret,
typename... Params,
typename... Args>
97 Ret peekDelta(
T34 t,
int delta, Ret (
TileCount::*f) (Params...)
const, Args && ... args)
const 99 T34Delta guard(mutableCounts(), t, delta);
101 return (this->*f)(std::forward<Args>(args) ...);
109 T34Delta(std::array<int, 34> &mCounts,
T34 t,
int delta);
112 T34Delta(
const T34Delta ©) =
delete;
113 T34Delta &operator=(
const T34Delta &assign) =
delete;
116 std::array<int, 34> &mCount;
124 explicit NonEmptyGuard(std::vector<Parsed4::Heads> &p);
128 std::vector<Parsed4::Heads> &mParseds;
131 std::array<int, 34> &mutableCounts()
const;
132 int cutMeld(
int i,
int maxCut)
const;
133 std::vector<Parsed4::Heads> cutMeldOut(
int i,
int maxCut)
const;
134 int cutSubmeld(
int i,
int maxCut)
const;
135 std::vector<Parsed4::Heads> cutSubmeldOut(
int i,
int maxCut)
const;
136 bool decomposeBirdless4(
Explain4Closed &exp,
const std::array<int, 34> &mCounts)
const;
139 std::array<int, 34> mCounts;
140 std::array<int, 3> mAka5s;
149 #endif // SAKI_TILECOUNT_H Parsed4s parse4(int barkCt) const
Parse this hand as 4-meld shape with minimal shanten number.
Definition: tile_count.cpp:354
util::Stactor< T34, 13 > t34s13() const
List all kind of tiles in this set.
Definition: tile_count.cpp:269
Definition: tile_count.h:22
bool dislike4(T34 t) const
Check if 't' is trivially not an effA4.
Definition: tile_count.cpp:318
util::Stactor< T37, 13 > t37s13(bool allowDup=false) const
List all tiles in this set.
Definition: tile_count.cpp:287
Definition: tile_count.h:17
bool covers(const TileCount &that) const
Definition: tile_count.cpp:120
Stactor = statically allocated vector.
Definition: stactor.h:247