/nix/store/rr0r40cw3mzzbz0sxrnkvnrjpzb82wpc-j27cjzgh5nmq3y8k6hwa6zpi3qgcjia8-source/src/scoring/yakus/doubleriichi.cc
Line | Count | Source |
1 | | #include "scoring/yakus/doubleriichi.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 isDoubleRiichi(const GameState& state, const Hand& hand, |
13 | 3 | const std::vector<const mahjong::Node*>& /*branch*/) { |
14 | 3 | return hand.riichi && !hand.open && (state.turnNum < 4 && state.lastCall < 0); |
15 | 3 | } |
16 | | |
17 | | REGISTER_YAKU({ |
18 | | .id = "doubleriichi", |
19 | | .name = "Double Riichi", |
20 | | .type = Yaku::kClosed, |
21 | | .value = 2, |
22 | | .is_yaku_func = yaku::isDoubleRiichi, |
23 | | }); |
24 | | } // namespace mahjong::yaku |