Coverage Report

Created: 2025-09-03 03:49

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/nix/store/i1aar97n7b4yf8rk94p66if25brfvvdx-gqvzl8a5pvrg3xj44q0msrndcripi8dk-source/src/scoring/yakus/threeconcealedpons.cc
Line
Count
Source
1
#include "scoring/yakus/threeconcealedpons.h"
2
3
#include <vector>
4
5
#include "analysis/handnode.h"
6
#include "scoring/yakus.h"
7
#include "types/gamestate.h"
8
#include "types/sets.h"
9
#include "types/yaku.h"
10
11
namespace mahjong::yaku {
12
bool isThreeConcealedPons(const GameState& state, int player,
13
11
                          const std::vector<const mahjong::Node*>& branch) {
14
11
  int concealed_pons = 0;
15
57
  for (const auto* node : branch) {
16
57
    if (node->type() == SetType::kPon) {
17
18
      concealed_pons++;
18
18
    }
19
57
  }
20
11
  for (const auto& meld : state.hands.at(player).melds) {
21
6
    if (meld.type == SetType::kConcealedKan) {
22
0
      concealed_pons++;
23
0
    }
24
6
  }
25
11
  return concealed_pons >= 3;
26
11
}
27
28
REGISTER_YAKU({
29
    .id = "threeconcealedpons",
30
    .name = "Three Concealed Pons",
31
    .type = Yaku::kOpen,
32
    .value = 2,
33
    .is_yaku_func = yaku::isThreeConcealedPons,
34
});
35
}  // namespace mahjong::yaku