/nix/store/i1aar97n7b4yf8rk94p66if25brfvvdx-gqvzl8a5pvrg3xj44q0msrndcripi8dk-source/src/scoring/yakus/fullyconcealedhand.cc
Line | Count | Source |
1 | | #include "scoring/yakus/fullyconcealedhand.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 isFullyConcealedHand(const GameState& state, int player, |
12 | 5 | const std::vector<const mahjong::Node*>& /*branch*/) { |
13 | 5 | return state.currentPlayer == player && !state.hands.at(player).open && |
14 | 5 | state.walls.GetRemainingPieces() > 0; |
15 | 5 | } |
16 | | |
17 | | REGISTER_YAKU({ |
18 | | .id = "fullyconcealedhand", |
19 | | .name = "Fully Concealed Hand", |
20 | | .type = Yaku::kClosed, |
21 | | .value = 1, |
22 | | .is_yaku_func = yaku::isFullyConcealedHand, |
23 | | }); |
24 | | } // namespace mahjong::yaku |