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