/nix/store/rr0r40cw3mzzbz0sxrnkvnrjpzb82wpc-j27cjzgh5nmq3y8k6hwa6zpi3qgcjia8-source/src/scoring/yakus/blessingofheaven.cc
Line | Count | Source |
1 | | #include "scoring/yakus/blessingofheaven.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 isBlessingOfHeaven(const GameState& state, const Hand& hand, |
13 | 1 | const std::vector<const mahjong::Node*>& /*branch*/) { |
14 | 1 | if (hand.open) { |
15 | 0 | return false; |
16 | 0 | } |
17 | 1 | if (hand.id != 0) { |
18 | 0 | return false; |
19 | 0 | } |
20 | 1 | if (state.hands[0].hasRonned) { |
21 | 0 | return false; |
22 | 0 | } |
23 | 1 | if (state.turnNum != 0) { |
24 | 1 | return false; |
25 | 1 | } |
26 | 0 | return true; |
27 | 1 | } |
28 | | |
29 | | REGISTER_YAKU({ |
30 | | .id = "blessingofheaven", |
31 | | .name = "Blessing of Heaven", |
32 | | .type = Yaku::kYakuman, |
33 | | .value = 13, |
34 | | .is_yaku_func = yaku::isBlessingOfHeaven, |
35 | | }); |
36 | | } // namespace mahjong::yaku |