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