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/threekans.cc
Line
Count
Source
1
#include "scoring/yakus/threekans.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 isThreeKans(const GameState& state, int player,
13
7
                 const std::vector<const mahjong::Node*>& /*branch*/) {
14
7
  int kans = 0;
15
18
  for (const auto& meld : state.hands.at(player).melds) {
16
18
    if (meld.type >= SetType::kKan) {
17
17
      kans++;
18
17
    }
19
18
  }
20
7
  return kans >= 3;
21
7
}
22
23
REGISTER_YAKU({
24
    .id = "threekans",
25
    .name = "Three Kans",
26
    .type = Yaku::kOpen,
27
    .value = 2,
28
    .is_yaku_func = yaku::isThreeKans,
29
});
30
}  // namespace mahjong::yaku