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/allterminalsandhonors.cc
Line
Count
Source
1
#include "scoring/yakus/allterminalsandhonors.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 isAllTerminalsAndHonors(
12
    const GameState& state, int player,
13
20
    const std::vector<const mahjong::Node*>& /*branch*/) {
14
189
  for (const auto& piece : state.hands.at(player).live) {
15
189
    if (!piece.isHonor() && !piece.isTerminal()) {
16
18
      return false;
17
18
    }
18
189
  }
19
2
  for (const auto& meld : state.hands.at(player).melds) {
20
1
    if (!meld.start.isHonor() && !meld.start.isTerminal()) {
21
0
      return false;
22
0
    }
23
1
  }
24
2
  return true;
25
2
}
26
27
REGISTER_YAKU({
28
    .id = "allterminalsandhonors",
29
    .name = "All Terminals and Honors",
30
    .type = Yaku::kOpen,
31
    .value = 2,
32
    .is_yaku_func = yaku::isAllTerminalsAndHonors,
33
});
34
}  // namespace mahjong::yaku