/nix/store/rr0r40cw3mzzbz0sxrnkvnrjpzb82wpc-j27cjzgh5nmq3y8k6hwa6zpi3qgcjia8-source/src/scoring/yakus/allhonors.cc
Line | Count | Source |
1 | | #include "scoring/yakus/allhonors.h" |
2 | | |
3 | | #include <vector> |
4 | | |
5 | | #include "analysis/handnode.h" |
6 | | #include "scoring/yakus.h" |
7 | | #include "types/gamestate.h" |
8 | | #include "types/hand.h" |
9 | | #include "types/yaku.h" |
10 | | |
11 | | namespace mahjong::yaku { |
12 | | bool isAllHonors(const GameState& /*state*/, const Hand& hand, |
13 | 0 | const std::vector<const mahjong::Node*>& /*branch*/) { |
14 | 0 | for (const auto& piece : hand.live_range()) { |
15 | 0 | if (!piece.isHonor()) { |
16 | 0 | return false; |
17 | 0 | } |
18 | 0 | } |
19 | 0 | for (const auto& meld : hand.melds_range()) { |
20 | 0 | if (!meld.start.isHonor()) { |
21 | 0 | return false; |
22 | 0 | } |
23 | 0 | } |
24 | 0 | return true; |
25 | 0 | } |
26 | | |
27 | | REGISTER_YAKU({ |
28 | | .id = "allhonors", |
29 | | .name = "All Honors", |
30 | | .type = Yaku::kYakuman, |
31 | | .value = 13, |
32 | | .is_yaku_func = yaku::isAllHonors, |
33 | | }); |
34 | | } // namespace mahjong::yaku |