/nix/store/i1aar97n7b4yf8rk94p66if25brfvvdx-gqvzl8a5pvrg3xj44q0msrndcripi8dk-source/src/scoring/yakus/blessingofearth.cc
Line | Count | Source |
1 | | #include "scoring/yakus/blessingofearth.h" |
2 | | |
3 | | #include <vector> |
4 | | |
5 | | #include "analysis/handnode.h" |
6 | | #include "scoring/yakus.h" |
7 | | #include "types/gamestate.h" |
8 | | #include "types/yaku.h" |
9 | | |
10 | | namespace mahjong::yaku { |
11 | | bool isBlessingOfEarth(const GameState& state, int player, |
12 | 0 | const std::vector<const mahjong::Node*>& /*branch*/) { |
13 | 0 | if (state.hands.at(player).open) { |
14 | 0 | return false; |
15 | 0 | } |
16 | 0 | if (state.turnNum > 3) { |
17 | 0 | return false; |
18 | 0 | } |
19 | 0 | if (state.lastCall >= 0) { |
20 | 0 | return false; |
21 | 0 | } |
22 | 0 | if (state.hasRonned.at(player)) { |
23 | 0 | return false; |
24 | 0 | } |
25 | 0 | return true; |
26 | 0 | } |
27 | | |
28 | | REGISTER_YAKU({ |
29 | | .id = "blessingofearth", |
30 | | .name = "Blessing of Earth", |
31 | | .type = Yaku::kYakuman, |
32 | | .value = 13, |
33 | | .is_yaku_func = yaku::isBlessingOfEarth, |
34 | | }); |
35 | | } // namespace mahjong::yaku |